DISCOVER: buttonFly.pde

Advertisements

DELIVER: myGame.pde

To finish off my game I had to create different speeds for my squares.

The middle square – which is controlled by the users click of the control button, moves faster than the right and left squares.

Screen Shot 2017-10-11 at 4.33.05 PM

The left square – chases the middle square at a slower speed than the middle and right square.

Screen Shot 2017-10-11 at 4.33.34 PM

The right square – chases the middle square at a faster speed than the left square but slower than the middle square.

Screen Shot 2017-10-11 at 4.34.06 PM

In order to not have my squares get stuck on top of each other I had to set a timer which starts off the squares at different times.

Screen Shot 2017-10-11 at 4.22.36 PM The slow square is the left square. Here is the code that I used to chase the middle square. The timer sets off the square to move, this time period gives the user some time to move the middle square and give it a “head start”.

For the right square I did the same thing but changed the starting time higher than the left square.

Screen Shot 2017-10-11 at 4.31.38 PM

The Final game looks something like this.

Screen Shot 2017-10-11 at 4.36.31 PM

DESIGN – myGame.pde

In the first 3 versions of my myGame I have been able to change the colors of my game screen, buttons, and also the color of my first square. I also made this square move by having the user use the control buttons. The middle button changes the square color, while the left button makes the square move left, the right button makes the square move right, the up button makes the square move up and the down button makes the square move down.

Though the square is moving with the right buttons, the square does not bounce when it hits the edge of the game screen.

Screen Shot 2017-10-11 at 4.08.12 PM

Screen Shot 2017-10-11 at 4.11.21 PM