Professional Documents
Culture Documents
https://x.thunkable.com/login
Design Blocks
For this screen, we simply want to We will only add one block of code that
welcome the user to the app and invite will go to the Maze screen when the “Let’s
them to start the maze. Begin” button is pressed.
Design Blocks
We will divide this screen into 3 sections: No blocks are needed for dividing up the
Header, Maze, and Footer. Maze screen, but MANY blocks will be
needed to manipulate the components
We will use the “Row” component to divide
within each screen.
the sections, and we will develop each of
the sections one at a time.
a. Section - Header
b. Section - Maze
c. Section - Footer
Design Blocks
We will add 2 components to this section: For the “Home” button, we will add blocks
that say:
1. A button to return to the Home screen.
2. A label to display the grid position ● ‘When Home button is pressed,
where we are in the maze. This will be navigate to the Start Screen.’
useful for testing in the future.
For the “Position” label, we will add blocks
We will position these 2 components in the that say:
top right and left corners.
● ‘When I change positions, get my
current position, and update the
position label.’
Add a Button to Return Home
a. x=2
b. y=3
Design Blocks
We will create a 3 x 3 grid by adding 3 We will define the maze using a double
columns that each have 3 buttons stacked array. On each move we will change the
vertically. players current position and update which
‘cell’ is displayed.
● We will set and change the
background images of the buttons to We will consider the maze completed if our
show what paths are available. position is ever less than or equal to 0 or
● We will toggle the ‘Disabled’ button greater than 3. We will rely on the maze walls
property to control which directions to only allow us outside of the perimeter
the player can move. when the maze has been solved.
Create the Maze Button Grid
1. Add 3 columns to the ‘Section - Maze’
row.
2. In each column add 3 buttons.
3. Use whatever naming convention makes
sense to you. Here is mine:
a. Column - Left
i. Grass - L - T
ii. btn.W
iii. Grass - L - B
b. Column - Center
i. btn.N
ii. Grass - Center
iii. btn.S
c. Column - Right
i. Grass - R - T
ii. btn.E
iii. Grass - R - B
Configure the Maze Buttons
For each of the 9 maze buttons:
1. Height = “60%”’
Add Default Background Images
For the 4 Corner buttons:
● BackgroundPicture = “Grass.png”
● BackgroundPicture =
“Middle_Path.png”
● BackgroundPicture =
“Vertical_Path.png”
● BackgroundPicture =
“Horizontal_Path.png”
Define the Walls of the Maze
1. Add a new variable called “maze”.
2. From our defined maze get whatever is in the current row. We determine current row by getting
the value in ‘y’. This will return a list of 3 objects that should be stored in currentCellRow.
3. From the list of 3 objects get the cell we are currently in. We determine current cell by getting the
value in ‘x’. This will return the object that defines the current cell’s walls. Store this in
currentCellWalls.
4. Do all of this in the displayCurrentCell function. Now we have the values of the walls for the cell we
are currently in.
Update the Buttons to Current Cell
1. Create a new function called
“updateButtons” that will update which
paths the player can take on the screen. We
will run this function every time the player
changes position.
a. N: y - 1
b. E: x + 1
c. S: y + 1
d. W: x - 1
2. Put what is currently in the displayCurrentCell function in an if statement that checks the
following before continuing.
a. x>3
b. y>3
c. x <= 0
d. y <= 0
Design Blocks
We will add a label that will display the For the “Moves Label”, we will add blocks
number of moves the player has made so that say:
far.
● ‘When I change positions, increase the
number of moves I’ve taken by one.
Then update the Moves Label with the
new move count’.
Add a Label to Show Move Count
4. In incrementMoveCount:
5. Call incrementMoveCount in
displayCurrentCell.
Test: Maze Screen - Footer
Design Blocks
For this screen we simply want to We will only add one block of code that
congratulate the player for completing will go to the Start screen when the
the maze and give them the ability to go “Reset” button is pressed.
back to the home page.
➔ Website: Amblemind.com
➔ Youtube: Thunkable X Tutorials
➔ Email: darren@amblemind.com