I'm making an Arkanoid or Brick Breaker game, but I got confused when I wanted to implement power-ups. The idea is that when you destroy a brick, a powerup-block falls down, and if you catch it you'll get the powerup. -for example:
- Wider Paddle (change dimensions of the quad)
- Change ball speed (variable)
- Ball goes through blocks (no reflection on hittest)
- Shoot lasers from the paddle (change in input handling)
Now I pretty much know how to affect the code to achieve these effects, however not in a clean, flexible way. I have my ie my ball and paddle hard-coded in java (GameObjects), and my Levels/BlockTypes in xml.
One terrible way to do it is to have like a flag telling which powerup is active, and by that alter the code with loads of if- statements.
Could anyone help me with how this is done?