Pass-Through: collision resolution is disabled for non-solid blocks, allowing the ball to pass through multiple blocks.This allows the player to better position the ball before releasing it. Sticky: when the ball collides with the paddle, the ball remains stuck to the paddle unless the spacebar is pressed again. ![]() Speed: increases the velocity of the ball by 20%.Within Breakout we're going to feature a total of 4 positive powerups and 2 negative powerups: Type(type), Duration(duration), Activated()Ī PowerUp is just a GameObject with extra state, so we can simply define it in a single header file which you can find here.Įach powerup defines its type as a string, a duration for how long it is active, and whether it is currently activated. : GameObject(position, SIZE, texture, color, VELOCITY), PowerUp(std::string type, glm::vec3 color, float duration, That's why we define a class PowerUp that inherits from GameObject: We can model a powerup as a GameObject with a few extra properties. We also include several negative powerups that affect the player in a negative way. For example, one powerup makes the paddle larger, and another powerup allows the ball to pass through objects. Such a block will slowly fall downwards and if it collides with the player paddle, an interesting effect occurs based on the type of powerup. The idea is that whenever a brick is destroyed, the brick has a small chance of spawning a powerup block. ![]() Breakout is close to finished, but it would be cool to add at least one more gameplay mechanic so it's not your average standard Breakout clone what about powerups?
0 Comments
Leave a Reply. |