Lab 9: Intro to Object Oriented Programming and Emergent Systems (November 5th, 2007)
In this lab / homework assignment, we will be creating a version of the game Lights Out, which we went over in class. Here is a playable version
online, called Disco Puzzle.
Start with the last example from the code for today.
Alter the graphics so the light MovieClip looks more like a spot on a grid (with a corresponding "on" and "off" state).
On the first frame, instead of creating only one grid spot (or light in our previous example), create a grid of them
using a 2D array. The user should be able to turn on and off grid spots (and make patterns) by clicking on them.
Instead of just turning on and off just one grid spot, make it so that when the user clicks a spot, adjacent squares
switch states as well, using the cross pattern seen in Disco Puzzle.
hint: Have your click event handler in your class call a function on your main timeline. This function will then
update all the other object in your grid.
It should work something like this:
When you are done, post both FLAs and SWFs to your website.