Physics for Arkanoid-like game

I’m relatively new to jME, I already followed the beginner tutorial and i was wondering how i could realize the physics of a game like Arkanoid (i think nearly all know it right? Link)

I suppose that the ball is controlled by a RigidBodyControl and it shouldn’t be affected by gravity (should it be kinematic?), but i don’t know how to get the bounce effect. I wanted to know if i’m taking the right way, if there is an easy way or if i should forget about physics for this kind of problems and playing around mathematic.



I’m not so good in English, but i hope it is understandable. Thanks in advance.

You don’t need to use physics per se for that, just change direction once you hit something

2 Likes

Yeah i suppose that’s the easier way.

However, just for information, is there an easy way to obtain a bounce like this with physics?

It could be usefull to know how to bounce things around if i will need it.

I’m sure there’s probably a way, but i doubt its easy, its a 3d physics engine, constrained to 2d space, i doubt it will end well :P, you might be better off looking into using slick2d if you really want to use physics so bad, but I don’t think you need it. Unless you doing something different? In the simplest case all you need to do, is add rigidbody/ghostcontrol to your objects with mass 0, listen for collision events and use trigonometry to move your ball, and whens theres a collision you interpret the available data and you do your action, which in its simplest case is just to inverse the axis which was hit. I believe pong was the first game created? uses same techniques

I was referring to some method or parameter to make something bouncy in general, not constrained in 2d space, because i was thinking to other kinds of games. You’re right on don’t using physics for this game and i won’t do it.

I agree with @wezrule Physics with that kind of game is overkill. Like using a 50 megaton thermonuclear warhead to kill a flea. It works, but… shrug



It shouldn’t be that hard to do that kind of “physics” by hand. The things you need to keep in mind are:



The paddle.

What’s it’s made of. Meaning the energy it will absorb / redirect. A rubber paddle would transfer most of the received energy back to the ball. Of course there’s different density of rubber…



The ball.

Same as the paddle but where things might get crazy is if you have a spiky ball for example…



The rest is more or less simple. Things that are important are: speed and angular attack. Google and Wikipedia are your friends if you want to delve into the world of trigonometry. :wink:



Good luck.

Ok, thank you all for the help :slight_smile: