Overview
TheMyConstant class contains static constants that define fundamental game parameters such as maze dimensions, character sizes, and debug visualization flags. These constants are used throughout the game to ensure consistent sizing and behavior.
Constants
Maze Dimensions
The width of the maze grid in tiles. Defines how many columns the maze contains.
The height of the maze grid in tiles. Defines how many rows the maze contains.
Size Parameters
The size of each maze tile in 3D units. This is the base unit for all spatial calculations in the game.
The size of game characters (Pac-Man and ghosts). Calculated as 90% of half a box size to ensure characters fit within tiles with some padding.
Debug Flags
When enabled, displays visual hitboxes around characters for debugging collision detection.
When enabled, displays hitbox visualization for maze walls and obstacles.
When enabled, visualizes the pathfinding routes used by ghost AI to chase Pac-Man.
Enables or disables shader effects in the game.
Usage Examples
Creating the Maze
Positioning Characters
Converting Between Grid and World Coordinates
Camera Positioning
Debug Visualization
Source Location
File:~/workspace/source/pacman/src/MyConstant.js:1
Related Classes
- MyMaze - Uses constants for maze generation
- MyCharacter - Uses size and hitbox constants
- MyGame - Uses all constants for game initialization