collision w/ 2 picture boxes

artem

New member
Joined
Feb 14, 2006
Messages
2
Programming Experience
Beginner
ok well im making a game and im having trouble finding some code that works. what i want is some code that makes my "guy"stop when he touches a "wall". well thnx ahed of time;)
 
Hello,

use a timer and an if statement to check if he is off the screen you can specify the pixels or i think you can say something like form.width or screen.width

Also if your interested in making games you may want to download Blitz Basic its a language for making games, it easy and free to trial ;)
 
assuming the "wall" is on the right side of your "guy"
VB.NET:
If (picGuy.Left + picGuy.Width) >= picWall.Left Then
   'Guy has reached the wall
End If
 
Back
Top