In Digitech we played a maze game to lean each tool and technique. In this table I explained what each tool did when it was played and it's Javascript Code. I had to take a screenshot of the game tool then copy&paste the tools javascript code explaining what the tool does. This is helpful if your wanting to create a game or learn how a game works.
Game Tool Command | Game Tool | Javascript Code | Technique - What does the tool do? |
Move Forward
|
|
moveForward();
moveForward(); |
The move forward tool enables the object or character to move forward
|
Move forward
|
moveForward();
moveForward();
moveForward();
|
The move forward tool enables the object or character to move forward
| |
Move forward
Turn right
|
moveForward();
moveForward(); turnRight(); moveForward(); |
The move forward tool enables the object or character to move forward
The right tool enables the object or character to turn right
| |
Move forward
Turn left
Turn right
|
moveForward();
turnLeft(); moveForward(); turnRight(); moveForward(); |
The move forward tool enables the object or character to move forward
The right tool enables the object or character to turn right
The left tool enables the object or character to turn left
| |
Move forward
Turn left
Turn right
|
turnRight();
moveForward(); turnLeft(); moveForward(); moveForward(); moveForward(); turnLeft(); moveForward(); |
The move forward tool enables the object or character to move forward
The right tool enables the object or character to turn right
The left tool enables the object or character to turn left
| |
Repeat 5 times
move forward
|
for (var count = 0; count < 5; count++) {
moveForward();} |
The repeat tool enables the object or character to repeat the forward movement tool
| |
Repeat of move forward tool 5 times
Turn right
|
turnRight();
for (var count = 0; count < 5; count++) { moveForward(); } |
The right tool turns the object or character facing right of a repeat of forward movement 5 times
| |
Move forward
Turn left
Repeat of move forward tool 5 times
|
moveForward();
moveForward(); moveForward(); moveForward(); turnLeft(); for (var count = 0; count < 5; count++) { moveForward();} |
The move forward tool allows the object or character to move forward with the left tool also allowing the object to turn left. Repeating the forward movement makes the object/character to move forward 5 times
| |
Move forward
Turn right
Repeat of move forward tool 5 times
Repeat of move forward tool 3 times
|
moveForward();
moveForward(); turnRight(); moveForward(); moveForward(); turnRight(); for (var count = 0; count < 3; count++) { moveForward(); } |
The repeat tool it allows movement to be repeated 3 times
| |
Repeat until target is hit
|
while (notFinished()) {
moveForward();} |
The technique enables the object/character to repeat the move forward tool until the target is hit
| |
Repeat until target is hit
Move forward
Turn left
|
while (notFinished()) {
moveForward(); moveForward(); turnLeft(); } |
The technique enables the object/character to repeat the move forward tool and turning left tool to hit the target
| |
Repeat until target is hit
Move forward
Turn left
Turn right
|
while (notFinished()) {
moveForward(); turnLeft(); moveForward(); turnRight(); } |
The technique enables the object/character to repeat the move forward tool and turning left tool also right tool
| |
Repeat until target is hit
Move forward
Turn left
Turn right
|
while (notFinished()) {
turnRight(); moveForward(); turnLeft(); moveForward(); } |
The technique enables the object/character to repeat the move forward tool and turning left tool also right tool
| |
Repeat until target
Turn left
Move forward
|
while (notFinished()) {
if (isPathLeft()) { turnLeft(); } moveForward(); } |
The technique enables the object or character to repeat the following path and tool.
If path to the left enables the object or character to always take the path to the left and keep moving forward with the move forward tool
| |
Repeat until target
Turn right
Move forward
|
while (notFinished()) {
moveForward(); if (isPathRight()) { turnRight(); } } |
The technique enables the object/character to move forward to repeat until the target is reached.
If path to the right enables the object to take the path to the right always turning right.
Move forward tools enables the object or character to move forward
| |
Repeat until target
Move forward
Turn left
|
while (notFinished()) {
moveForward(); if (isPathLeft()) { turnLeft(); } } |
The repeat until technique allows the tools you have put into, to repeat until the target is hit.
Move forward tools enables the object or character to move forward.
If path to the left allows the object or character to always take the path to left and the turn left tools to turn left
| |
Repeat until target
Turn right
Move forward
|
while (notFinished()) {
moveForward(); if (isPathRight()) { turnRight(); } } |
Repeat until target is hit enables the tools to repeat until the target is hit
If path to the right allows the object/character to take the path to the right with the turn right tool to turn right
| |
Repeat until target
Move forward
Turn left
|
รง
|
Repeat until target is hit enables the tools to repeat until the target is hit
If path ahead enables the object/character with move forward tool to keep moving forward ahead of the path turning left with the turn left tool
| |
Repeat until target
Move forward
Turn right
|
while (notFinished()) {
if (isPathForward()) { moveForward(); } else { turnRight(); } } |
Repeat until target is hit enables the tools to repeat until the target is hit
If path ahead enables the object/character with move forward tool to keep moving forward ahead of the path turning right with the turn right tool
| |
Repeat until target
Move forward
Turn right
Turn left
|
while (notFinished()) {
if (isPathForward()) { moveForward(); } else { if (isPathRight()) { turnRight(); } else { turnLeft(); } } } |
Repeat until target is hit enables the tools to repeat until the target is hit
If path ahead enables the object/character with move forward tool to keep moving forward ahead of the path
If path to the right enables the object/character to take the object to the right path with the tools, turn right turning right and turn left turning left.
|