I was wondering if anyone with any knowledge in visual basics and physics would help me with making the ball bounce of moving objects like the paddles with velocity and a faster speed depending on how fast or how the ball has been hit
thanks
I was wondering if anyone with any knowledge in visual basics and physics would help me with making the ball bounce of moving objects like the paddles with velocity and a faster speed depending on how fast or how the ball has been hit
thanks
This are never good physics. With a standard pong field where the ball is going from left to right and back to left, the paddles would only go up and down. The new speed of the ball would be the Xspeed *= -1; , but if it hits a moving paddle, you can add to the Yspeed and a percentage of the original speed of the paddle depending on the friction those two objects got.
If you want to have objects that can be hit from multiple sides with different shapes it's more complex, how complex do you want to make it?
edit: mix'd the x and yspeeds a bit ^^
Last edited by masterBB; 10-13-2011 at 06:15 PM.
Working on: Tithe Farmer
well just enough so the velocity changes with the bounce I don't want it to be as simple as it can be lol, sorry about the late replies -.- dubstep + youtube = me maxing my bandwidth? ;D
I wouldn't mind helping with the code. But I don't feel like posting exactly how to do this. If you're having trouble getting something right please send me a pm with the problem but I am not going to hold your hands with this. There are like one billion tutorials on this problem. Maybe someone else wants to help you, but I don't have enough time, sorry.
Working on: Tithe Farmer
ah okay i was just wondering on how to get the ball to go in the direction if anyone could give me like a equation and explain it then that would be more then helpful
Using the speed of the paddle might be a bit hard (as you don't really know the speed? Or are you planning on tracking that?). In my lil' experiment, I played a bit with the angle of the ball with the bat (small change when you hit the center of the bat, big change when you hit an edge). Magic happens around line 1720, but it's really specific to my liking.
There are currently 1 users browsing this thread. (0 members and 1 guests)