The move part has to be done in different way.
You have to have a lot of if statements.
You start to move (no mather of direction)
1 - if is floor, move
2. if is not floor - check if is the wall
3. if is wall, don't move
4. if is box, check next space
now same procedure (same stuff) with next box
1. if is floor, move
2. if is not floor, check if is the wall
3. if is wall, don't move
4. if is box, check the color
5. if is same color go to next box
6 if is different color color, don't move
You can move only in 4 directions, this make it easy!
|