Design Lab 5: Game Media   [ Monday 6pm - Rm 908]

instructor: Jonah Warren
email: jonah AT feedtank DOT com
url: http://www.playfulsystems.com/teaching/2007/gamemedia


Lab 3: Event Handlers
(September 24th, 2007)

  1. In this lab, you will be combining a few of the concepts we've gone over in class to make the beginnings of a game. Go through the following steps one by one.
    • Start with the code from EnterFrame in class here (download the FLA).
    • Get rid of the restart button, and make it so that when the box reaches the end of the Flash stage, it wraps back to the other side.
      [ Hint: You will need to use an if statement in your enterFrame function and use the stage.stageWidth property. ]
    • Make it so that when the box wraps to the other side, it is set to a random yposition on the stage.
      [ Hint: You will need to use the Math.random() and stage.stageHeight function inside your if statement. ]
    • Add one more block to the stage, and have it do the same thing.
    • Now, take the hitTest code from class here. Add another box to the stage which you can move up and down (rather than left and right like this example). Use the same code to check if your moveable box is hitting either scrolling box. If it is, then turn the box green, like in the example.
    • BONUS: If you complete this quickly, dynamically create a number of scrolling obstacles with a for loop, and do the same. You might want to make the stage bigger.
    I'm looking for something like this:


    [ Click the movie and use the up and down arrows to move your guy. ]

  2. When you are done, post both FLAs and SWFs to your website.