INQ241B
Mobile Apps

Activity 8

Sprite Sets

Modify your Pong game from last class to be the game Breakout. In Breakout there are a bunch of bricks on the top of the screen. The ball bounces off of the bricks just like it bounces off of the paddle. However, when the ball bounces off a brick it dissapears.

  1. Modify your game from the last class to have bricks at the top of the window. Each brick should be a sprite in a sprite set. The bricks should be arranged in a row across the top. Use a for loop to create each brick and add it to the sprite set.

  2. Modify the game so that the ball bounces off of the bricks. Use a for each loop inside the on every frame function to ‘bounce’ the ball and delete the brick when the ball intersects with a brick. To delete a brick use the sprite->delete function.

Submission

Please show your source code and run your scripts for the instructor or lab assistant.