Computer Science Canada having a problem with my game |
Author: | wallc++ [ Wed Apr 08, 2009 9:08 pm ] | ||||
Post subject: | having a problem with my game | ||||
program: pong made in : vb6 the problem im having is a colision problem i think. the picture that is attached shows the problem thanks for the help
Mod Edit: Remember to use syntax tags! Thanks
|
Author: | deathbow2134 [ Sun Apr 12, 2009 8:56 am ] |
Post subject: | Re: having a problem with my game |
I find this very hard to follow without the rest of your code. If you could post all of your source code I'm sure I could help you. |
Author: | wallc++ [ Sun Apr 12, 2009 7:55 pm ] |
Post subject: | Re: having a problem with my game |
that is all the code i just dont know how to get something to stop when it hits something |
Author: | DifinityRJ [ Wed Apr 29, 2009 10:48 am ] |
Post subject: | Re: having a problem with my game |
You could use rectangular collision to check if the ball is within the bounds of the paddle. There are so many tutorials on rectangular collision on these forums. I would explain it, but I haven't coded in VB for a while now, and I remember the Y values worked different in VB. Anyways the basic idea is: if the ball is within the parameters of the paddle, then reverse the x velocity of the ball, making it bounce off of the paddle. For example : if the ball hit the paddle then x_velocity_of_ball := -x_velocity_of_ball end if Good luck! |
Author: | wallc++ [ Wed Apr 29, 2009 10:56 pm ] |
Post subject: | Re: having a problem with my game |
umm well the program works fine in that aspect the ball bounces of the blocker its the blocker its self. its not stoping at the bounds of the game. in short i know how to program bounce code but i dont know how to make something stop when it hits somthing.like hiting a wall then for it to stop not bounce off. |