Love the enhancements! The "Game Over" display at the end really pulls it together.
I originally explored use of classic maze following behavior, but decided that a grid worked better in this situation. A couple of enhancements that might be useful could include: (1) adjusting the speed of the ghost chasing the Pacman to reflect the skill and dexterity of the player, and (2) provision of additional levels if the first level is cleared.
I primarily did this to get a sense of what might be involved in creating a maze game of this sort, with goal of generating some general guidelines that could be used to facilitate invention of original maze games in Snap! If there has been other work describing general strategies for developing maze games in Snap!, I would be interested in reading about it.
The code used to build the maze is still in the file. A procedure, Build Game Board, uses two subprocedures, Box and Walls, to draw the game board. The Box procedure draws a box around the game board. The Walls procedure draws the walls within the box.
A procedure, Record Grid Positions, was used to record a list of all the positions on an 9 x 9 grid spaced 25 steps apart. (This procedure uses a global variable, "List of Positions", that was subsequently deleted, so this variable would need to be recreated before running the procedure.)
The result was saved in a reporter block, Grid Locations:
The Wall Locations were then removed from the Grid Locations to create a reporter block, Path Locations, with a list of all of the valid path locations:
The Path Locations reporter block is used to determine where the Pacman is allowed to travel.
This initial setup enabled me to create a prototype to see if this approach would work. If different levels were created, it might be nice to generate the game board using an algorithm rather than manually.
We're planning to work on addition of a joystick controller next week. We got it semi-working on Friday, but there were latency issues, so it wasn't very smooth. Hopefully we can improve the responsiveness of the joystick when we take another look at it. We'll post details if we make any progress.
It seems that the MB KeyPress sends a key-down report immediately followed by an key-up.
So any project that pulls a keyboard state with , may not work reliably.
We're planning to work on some MicroBlocks documentation to support use of an arcade joystick with Snap! games. Once we have a draft, we'll post here for review.