Lab 9: Intro to Object Oriented Programming and Emergent Systems (November 13th, 2006)
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.
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 ( 2d array help ). 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: In the onPress function in your Light (or GridSpot class if you renamed it), call a function that is defined
on the first frame of your movie, which will turn on and off the appropriate adjacent spots. You will need to pass in its
coordinates in your 2D array. It could look something like this: