extend
Add a color property to the Pulse class which is set through a parameter passed to the constructor (similar to x and y).
Here is my solution.
refine
Modify the "Strength in numbers" game so that when ENTER is pressed, 25 Soldiers appear in random positions on the window. Do this by adding a second constructor to Soldier which takes no arguments and gives the created Soldier a random position.
Here is my solution.
debug
If you play with the "Strength in numbers" game for a little while, you will notice a couple of bugs.
- Some Soldiers get "stuck" on one of the edges if they ever slightly go out of frame. (You can replicate this bug by creating a bunch of Soldiers close to an edge.)
- If a Soldier gets too big, it doesn't know how to place itself on screen and either disappears or flickers.
Base yourself on the code from the previous exercise and fix these two bugs.
Here is my solution.