

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Draw Lines
incomplete
2: Cell
incomplete
3: Draw Move
incomplete
This lesson's interactive features are locked, please to keep using them
Our maze is made up of little boxes in a grid. Each box we call a "Cell", and it has 4 potential walls. The way the maze works, is that we start in one cell, and we're allowed to move to an adjacent cell as long as there isn't a wall in the way.
Let's build a Cell class that holds all the data about an individual cell. It should know which walls it has, know where it exists on the canvas in x/y coordinates, and have access to the window so that it can draw itself.
True)True)True)True)__x1 (starts as -1.0)__x2 (starts as -1.0)__y1 (starts as -1.0)__y2 (starts as -1.0)__win__x1, __y1, __x2, and __y2 data members.Lines and Points.