MAZE Frenzy -A Pac-Man - Inspired MATLAB Arcade Game

What happens when you take a classic Pac-Man style maze game and limit the player to just one button?
That was the idea behind MAZE FRENZY, my entry for the MATLAB One Button Game Mini Hack.
The player moves automatically through a maze, collecting pellets while avoiding four pursuing ghosts. A single click changes direction at available turns. Power orbs temporarily reverse the chase, allowing players to capture ghosts and earn bonus points.
How to play
  • Collect pellets for 10 points each.
  • Collect power orbs for 50 points.
  • Capture powered up ghosts for 200 points.
  • Survive with three lives.
  • Clear the maze to advance to faster levels.
Gameplay screenshot
Figure1. Maze gameplay showing the player, ghosts, pellets,
power orbs, and scoreboard.
Inside the MATLAB code
The game follows the init,update, and render architecture.
  • init constructs the maze and initializes graphics.
  • update handles movement, collisions, scoring, and ghost behavior.
  • render updates the existing graphics objects.
The maze uses a logical matrix (true for walls and false for paths). MATLAB functions such as image, scatter, text, find, set, abs, and sprintf handle the graphics and game logic. Ghosts use Manhattan distance calculations to pursue the player and retreat when a power orb is active.
What I'd improve next
I would like to explore breadth first search for smarter ghost navigation, individual ghost personalities, procedural maze layouts, and smoother character animation.
The interesting challenge was making a familiar arcade game work with just one button. It turns movement into a strategic excercise in timing and anticipating the next junction.
How would you approach ghost AI in MATLAB for shortest path search or individual enemy behaviors?