Trying to push the limits of App Inventor!
Snippets,
Tutorials and
Extensions from
Pura Vida Apps by
Taifun.
This is what I came up with.
It allows the hero ImageSprite to move around the maze based on the data stored in a csv table.
The data in the MazeMoves text file looks like this:
00,dr
01,lr
02,ld
03,r
04,lr
05,lrd
06,l
07,dr
08,lr
09,l
:
90,r
91,lu
92,ur
93,lr
94,lr
95,l
96,ur
97,ul
98,ur
99,ul
There are 100 rows in the table for each square in the puzzle.
This csv table is read into a lookup in pairs list.
When an arrow button is pressed, the direction (l,r,u,d) is passed to a procedure which does a lookup for the row and column of the hero sprite, determines if that direction is allowed, then moves the hero if so.
As an aid to determining which directions are allowed for each square in the maze, I numbered each row and column 0 to 9:
---
Happy Inventing!