Week 1 Day 6: Lab - Finish up the Side-Scrolling Platform Game

Learning Objectives:

  • Documentation of code
  • Organize code using functions
  • Use of functions that take parameters
  • Use of variables; no hard-coded values
  • Implement simultaneous key presses

 

How the Completed File Works:

File #1:

SPACEBAR to make the character jump up. LEFT and RIGHT arrow keys to move the platforms, the spinning coin, and the "?" box. The coin disappears when the character touches it. A spinning coin pops up when the character touches the "?" box. The platforms can be continuously scrolled. The spinning coin and "?" box reappear at random horizontal location after they are collected or scrolled off the stage for a certain distance. Also, pressing SPACEBAR while scolling the platform does not interrupt the scrolling.

Students, Don't forget to do the last step of the lab, which is documentation of code, organizing the code using functions, and using variables instead of hard-coding values. These are not something different you can see on screen; the game plays the same with or without organizing the code using functions, documentation of code, or replacing hard-coded values with variables. However, these are the best practice of programming.