Jay's Game App

by JayYang95

09 Mar 2016

Original Milestones:

  • [] Movement controlled by arrow keys
  • [] Keep track of counter variables for points
  • [] Click events to change game settings
  • [] Replay option
  • [] Use more modules
  • [] Win condition when enough points accumulated and user has reached certain area that ends the game
  • [] Lose condition that ends the game

Revised Milestones:

  • Movement controlled by arrow keys
  • Keep track of counter variables for points
  • Replay option
  • Use more modules
  • Create a class
  • Win condition when enough points accumulated
  • Lose condition when user collides with enemy
  • Click events to change game settings(difficulty)
  • Display current settings and state of counter variable
  • Randomly place enemies
  • Randomly place collectables
  • Have enemies move completely randomly without moving outside of the screen

Reflection:

Original game mechanics - I wanted to have the user be able to move the main turtle with the arrow keys. Specifically, I wanted it so that pressing up would make the turtle face up and move up, pressing left would make the turtle face left and move left, and so on. I managed to get this to work. However, I was extremely bothered by the fact that I could not get the turtle to face diagnoally when two keys were pressed at once. Instead it would move diagonally, but its heading would rapidly fluctuate between the two keys pressed. I tried to create some boolean variables such as “goingup” or “goingright” that were initialied to False and would equal True whenever their respective key was pressed, then turn back to False when it was released. That way, pressing up and right at the same time would set both goingup and goingright to True. We could check for this in the key functions and if they were both True, then we would set the turtles heading to be between 0 and 90 = 45. Unfortunately, I think when the user holds down a key, it is registered as rapdily pressing the key rather than one long hold and release, which made my logic invalid.

Revised mechanics - Because I couldn’t fully get the intended arrow key movement to work, I just made it so that up and down were forward and backwards respectively and left and right turned the turtle. I also intended for there to be a replay option, but I could not get it to fully work as my collectable turtles and counter variable were not resetting correctly. A final feature that I left out was requiring the user to collect all the “points” AND reach a certain area to win. I decided to only require the points. I had the difficulty settings increase the speed and maximum distance travelled in one instance of the enemy turtles. I had intended the difficulty settings to also increase the amount of enemies and collectables but did not have enough time to implement them.

Here's a little about JayYang95 Find JayYang95 on Twitter, Github, and on the web.