PDA

View Full Version : Arkanoid: paddle/ball movement theory and math



ErosOlmi
05-06-2008, 06:32
Hi,

I was playing last night with Arkanoid script and thinking about what could be the theory and math behind the interaction between the paddle and the ball.

For a good interaction and being able to apply to the ball some nice and precise effect, direction, control, I think more variables are to be taken into consideration:

angle of the ball
direction from where the paddle was coming just before hitting the ball
place inside the paddle where the hit with the ball take place (center, left side, right side or other subpart of the paddle)


Even imagine that the ball can have its own effect so another info we can add to the ball is: current effect, I mean the rotation of the ball on its own axes. When the ball hit a brick or the paddle with a local rotation, this will influence the next angle/rotation.

Just brain storming with myself.
What do you think?

Eros

Michael Clease
05-06-2008, 14:21
I did notice that when i played it the collision was wrong, if you are lined up with a block and fire the ball without moving it should hit that block and come straight back at you, not shoot off at a right angle away from you.

I think traditional game only did angles if you release the ball while the paddle is moving.

ErosOlmi
05-06-2008, 15:06
Abraxas,

current version just apply a random angle to the ball when it hits the paddle.
That's the raason why I made this post because ball movement and its math is an important point for this project.

Ciao
Eros

ErosOlmi
05-06-2008, 15:08
There is an interesting Arkanoid clone written in Python at http://www.scriptedfun.com/arinoid-an-arkanoid-clone/
I tested it. It can be a nice study for ball movements.

Petr Schreiber
05-06-2008, 15:32
Hi,

more mathematically correct bouncing sounds good to me.
I am still experimenting with that exact breaking of bricks to pieces ( = totally irrelevant stuff, but would be interesting :) ).

Thanks for the Python sample, looks good. I just ... don't want to see any Python code for a few light years, I enjoyed it too much for my bac. thesis ;D


Petr