กลับไปหน้ารวมไฟล์
challenging-maze-game-42dda2-en.md

Introduction

This project is a Maze game for Arduino. I developed the code specifically for the Arduino Esplora, but can be deployed in any Arduino by replacing the Esplora and EsporaTFT libraries by purer code.The mazes are character sequences of 't's (path) and 'f's (wall), which form a grid. The maze size is 64x64, and is displayed in 4 quadrants of 32x32 tiles. When the player reaches the edge of the quadrant, the game renders the next quadrant.

Maze file format:

<int>;<int>;<int>;<int>!<char[1024]!<char[1024]!<char[1024]!<char[1024]

Which translates to:

entryRow, entryCol, exitRow, exitCol, quadrant0, quadrant1, quadrant2, quadrant3

The quadrants are displayed as:

0000 ... 1111
0000 ... 1111
0000 ... 1111
.... ....
2222 ... 3333
2222 ... 3333
2222 ... 3333

The edge of the 64x64 maze should be made of walls ('f') except for both entrance and exit.There should be two, and only two path blocks on the edge of the maze, which will be the Entry and Exit of the maze. It is possible to load an infinite number of maze files (I provide a zip file with a few randomly generated mazes).

Hardware

The only hardware used in this project were:

  • Micro SD card

Installation

  • Unzip the maze file pack in the root of the micro SD card
  • Compile the Sketch with the Arduino IDE and upload it to your Arduino Esplora.

Usage

Maze selection

  • Joystick - Browse / Select a maze.
  • Top button - Preview the maze.
  • Bottom button - Start the maze.

Maze game

  • Joystick - Move through the maze.
  • Top button - Preview the whole maze.
  • Right button - Cancels the maze and go back to selection screen.

Victory screen

  • Bottom button - Dismiss and go back to the maze selection screen.

Feedback?

I appreciate feedback of any kind. Just give a message or post in issues. Thanks!

EXPANDED TECHNICAL DETAILS

Interactive Puzzle Logic

This project builds a physics-based "Labyrinth" game where the player navigates a virtual ball through a maze using a joystick or an accelerometer.

  • 2D Grid Mapping: The maze layout is stored in the Arduino's memory as a 2D array (Bitmask). 1s represent walls, and 0s represent paths. The player's position $(X, Y)$ is updated every frame based on input.
  • Collision Detection: The firmware constantly checks the surrounding grid cells; if the player tries to move into a wall cell (1), the movement is blocked, mimicking physical collision.

Game Mechanics

  • Timer and Levels: Includes a high-precision timer using millis(). Advanced versions feature multiple levels stored in Flash memory, with increasing difficulty and narrow paths, providing a challenging and polished gaming experience on an I2C OLED or TFT screen.

ข้อมูล Frontmatter ดั้งเดิม

title: "Challenging Maze Game"
description: "A fun maze game for Arduino (optimized for Esplora) that uses a large map."
author: "gmussi"
category: "Gadgets, Games & Toys"
tags:
  - "maze"
  - "games"
views: 7784
likes: 5
price: 2450
difficulty: "Easy"
components:
  - "1x Arduino LCD Screen"
  - "1x Arduino UNO"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://github.com/gmussi/Arduino-Esplora-Maze-Game"
  - "https://github.com/gmussi/Arduino-Esplora-Maze-Game"
documentationLinks: []
passwordHash: "c25e6e039b104c4c7372222c9a671162832b5c09a1b0520d2df7dc346dab6d64"
encryptedPayload: "U2FsdGVkX18hUwds0oIhoL9VXy8zchPG5gLsd0InhXhidBnLnHc2Gm7U4V7s4pRvJTZXywsfh34+zlBYfX57LIpVKv82C2SOWRWp8jTv7k0="
seoDescription: "Challenging Maze Game for Arduino and Esplora featuring large maps and fun gameplay."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/challenging-maze-game-42dda2_cover.PNG"
lang: "en"