This site requires JavaScript, please enable it in your browser!
Greenfoot back
danielartine
danielartine wrote ...

2015/2/25

Trying to create and Arkanoid

danielartine danielartine

2015/2/25

#
Hey guys, i'm new here, can you help me? I'm trying to create and Arkanoid game and i don't know exactly how to applicate the gravity and interaction between the bar and the ball, any tips please?
danpost danpost

2015/2/25

#
There is no need for "gravity" in the game as either the ball, when in the world, is either moving or it is stopped on the bar. So, there are three states for the ball (1) non-existent; meaning either the game is over (lives are exhausted) or a new ball needs added to the world; (2) stopped on the bar (when added to the world); and (3) moving (after released from the bar). The world act method can deal with state one (keeping track of lives, "barring" new balls and processing game over). State two can be done in the Bar act method with the use of an Actor field to hold any ball currently stopped on the bar (bar movement will move the ball, if on the bar); also detecting of the ball release trigger should be done in the Bar act method. State three is all ball (movements, detecting other object, and self-removal if not kept in play). If you run into problems in the coding process, post the code you tried and explain how it is currently acting and how you would rather it act like.
danielartine danielartine

2015/2/26

#
Ok, thanks, i'll try do something.
You need to login to post a reply.