[HELP] (Picturebox.Location) .fail game
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
6 posts
Page 1 of 1
Hey,
I'm trying to create a simple game but i need to know how to give a message when the block falls out of the form.
or to right or to left of the form.
i know that you can change the location of the picturebox with
PictureBox1.Location = New Point(100, 100)
i need to make somthing like
If picturebox1.location = (200,200) then
msgbox "FAIL"
end if
somthing like that or
if picturebox1.location.X = 200 and picturebox1.location Y = 200 then
msgbox "Fail"
end if
or
if picturebox1.location.X.Y = (200,200) then... enz
I hope you understand what i mean.
I'm trying to create a simple game but i need to know how to give a message when the block falls out of the form.
or to right or to left of the form.
i know that you can change the location of the picturebox with
PictureBox1.Location = New Point(100, 100)
i need to make somthing like
If picturebox1.location = (200,200) then
msgbox "FAIL"
end if
somthing like that or
if picturebox1.location.X = 200 and picturebox1.location Y = 200 then
msgbox "Fail"
end if
or
if picturebox1.location.X.Y = (200,200) then... enz
I hope you understand what i mean.
Hello,
Something like this maybe:
Picturebox goes off top:
Should work.
Something like this maybe:
Picturebox goes off top:
Code: Select all
Picturebox goes off bottom:
If PictureBox1.Location.Y < 0 Then
MsgBox("Fail")
End If
Code: Select all
Picturebox goes off left:
If PictureBox1.Location.Y > 200 Then
MsgBox("Fail")
End If
Code: Select all
Picturebox goes off right:
If PictureBox1.Location.X < 0 Then
MsgBox("Fail")
End If
Code: Select all
If PictureBox1.Location.X > 200 Then
MsgBox("Fail")
End If
Should work.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Use a timer ? I think that's what you're looking for
Put
1000 = 1 second
Put
Code: Select all
Put that into a timer, set it to Enable = True, Interval = How ever many seconds you you want to check ; per tickIf picturebox1.location = (200,200) then
msgbox "FAIL"
end if
1000 = 1 second
lol good idea use timers in a game but u should use darkbasic to make a game as i m not sure how easy it will be to code one in Visual Basic
thnx but i think i just keep it visual basic for now
Codenstuff code works fine thnx btw i already tried that nowayin
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023