- This allows students to practice new concepts they’ve learned on a program they can show off without having to know how all the pieces fit together right away.
- Students also gain practice working with code created by other programmers.
- Before class starts, prepare a program for students to iteratively add to.
- Games work very well.
- Rodriguez found Snake to be particularly effective.
- Make sure your program works out-of-the-box.
- Your game should execute, but it should be a "bare bones" implementation.
- A bare-bones implementation of Snake might simply draw a List of squares on the screen and let you move the snake by hitting the directional arrow keys.
- Students should be able to run the game without any errors and be able to interact with it at basic level.
- As you cover topics in class, return to the game and add new features.
- These will be mini-assignments throughout the semester for students to implement themselves.
- Students get to focus exclusively on applying knowledge from a specific lesson because the overall structure of the program is already provided.
- Not needing to worry about the overhead of user interface (UI), drawing, class design, and other concepts not yet covered keeps students from becoming overwhelming.
- Examples of enhancements to a Snake game include:
- Adding an integer variable to keep track of the score as the snake eats food (Variables).
- Extending the food class to make new types of food (Inheritance).
- Food that makes your snake fast, by alters the speed of the snake.
- Food that makes your snake slow.
- Food that changes the color of your snake, rainbow food.
- Food that changes the direction of your snake, where the head becomes the tail.
- Food that moves your snake to a random location.
- Make the snake grow longer when it eats food (List Manipulation).
- Add an item to the List, or the other data structure being used to represent the snake when the snake eats food.