The Daily Click ::. Forums ::. Klik Coding Help ::. The math physics of a pong like ball?
 

Post Reply  Post Oekaki 
 

Posted By Message

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
6th November, 2005 at 09:22:59 -

Hey all, small question about the physics you would use to re-create the "bouncing ball" movement, from MMF. Usually I would just used the bouncing ball movement because on adverage, its never really been buggy or proven to be annoying like the other movements, but I think learning how to make a custom one might be pretty useful in my case. Anyone know?

 
http://www.facebook.com/truediamondgame

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
6th November, 2005 at 09:39:19 -

As far as I know, in Pong the ball's Y movement simply reversed if it collided with a horizontal surface, and the X movement reversed after hitting a vertical surface. You could also change the angle at which the ball is travelling if it hits near the side of a paddle.

To move, you could use the ball's A and B values, and move it by those number of pixels each time. You may also need detectors to determine the angle of the surface that a ball has hit.

 
http://www.davidn.co.nr - Games, music, living in America

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
6th November, 2005 at 09:57:21 -

Thanks, I'll give that a shot.

 
http://www.facebook.com/truediamondgame

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
15th November, 2005 at 19:44:36 -

I made a fastloop breakout engine a while ago using the technique Wong described, but without any detectors. It works decent enough, and has the ability to change the ball's angle based on where it hits the paddle like in DXBall.
http://www.create-games.com/download.asp?id=4670

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames
   

Post Reply



 



Advertisement

Worth A Click