Games from Nothing: Black & White Exercise #2 — Son of Thomas

The Son of Thomas was originally based on me naming the first square that I coded, Thomas. However, as the story goes, the square coded as Thomas is actually a monster that shoots out fire that can hit the real Thomas, or his son, which are at the bottom of the screen (the monster is at the top). Thomas’s son bounces along the x axis, and Thomas is controlled by the mouseX coordinates of the player, with a fixed Y value. When Thomas collides with his son, the son bounces against him, and gains a small value of movement speed. As the game progresses, Thomas’s son gets more frightened, and runs quicker and quicker. The monster first shot fire out of only one x location, at 400, but I coded it to shoot at a random position, and then an approximation close to Thomas and his son. If the fire hits Thomas or his son, the score counter stops, and the game ends.