Computer Science 15-110, Lecture 9 (Sections M-Q), Fall 2009
Lab 6 (Midterm + Snake!)
Due:  Thu 22-Oct-2009 at 10pm (email copy to your CA)
(no late submissions accepted).


Read these instructions first!



Programming guidelines:

  1. Midterm Redux
  2. Snake Extensions
  3. Bonus/Optional:  More Snake Extensions

  1. Midterm Redux
    Working in a group (this is a lab, after all), write a solution set to midterm #1.  Include your answers in the free-response portion (in Lab6.txt, or whatever extension you use).
     
  2. Snake Extensions
    In the file Lab6Snake.java, add the following features to the game of Snake that we wrote in class (here is Snake.java as we wrote it (well, with one bug fix!)):

    1. Multiple moves per timer event
      As written, the snake only moves on timer events.  So, for example, if you hit RIGHT then UP very quickly (in less time than a single timer event delay), then the snake will not go right then up, but only up (the last direction pressed).  Fix this so that you can rapidly make several moves between timer fired events.
       
    2. Snake traps
      Snake traps work just like food, only they are painted red instead of green, and the snake dies if it crawls into one.  Also, each time the snake eats another morsel of food, another snake trap is placed randomly somewhere (so at first there is one snake trap visible, then two, then three,...).
       
  3. Bonus/Optional:  More Snake Extensions
    In the file Lab6SnakeBonus.java, add the following additional features to the game of Snake that we wrote in class:

    1. Simple features
      (do whichever you like -- each is worth 1/2 point up to 3 points max, if done really well)
      • A score.
      • A countdown timer.
      • Multiple snake lives.
      • A high score file.
      • A splash screen (at the start of the program) and a game over screen.
      • A help screen.
         
    2. More challenging features
      (each worth 1 point up to 6 points max, if done really well)
      • Impediments (walls, traps, etc).
      • Eagles (they attack and eat snakes).
      • Portals (as the snake enters a portal, it magically teletransports to emerge from a different portal, so for a while there are two partial snakes on the board)
      • Two players (one gets arrows, the other gets AWSZ or some such).
      • Significantly better graphics and sounds.
      • Levels with increasing challenges (faster play, more impediments, smarter eagles, etc)

    Be creative!!!  Have fun!!!


Carpe diem!