
Energy Guardian Adventure is a dynamic 2D action game developed with Phaser 3, where players must collect renewable energy while avoiding obstacles. You take on the role of an Energy Guardian, navigating through challenging levels to help restore the environment.
You can play this project directly on my website: https://t2ne.eu/energy-guardian/
Key Features
The game includes four distinct levels, each with unique environments and increasing difficulty. Combat is dynamic, allowing players to shoot fireballs to destroy obstacles and collect energy. Controls are responsive: movement is handled with keyboard arrow keys and attacks with mouse clicks. On mobile devices, an on-screen joystick is available for ease of play. As you complete challenges, new levels are unlocked. The game also features a dynamic sound system with background music and sound effects, all of which can be adjusted individually. A fully functional pause menu preserves the game state.
Gameplay
Players move using the arrow keys (or touchscreen joystick) and shoot fireballs by clicking the mouse. Obstacles can be destroyed to gain energy, and players must reach a set energy goal before time runs out. Colliding with obstacles reduces lives. Completing a level unlocks the next, progressively increasing the challenge.
Technical Details
The game was developed using the Phaser 3 game engine. It uses sprite-based animations with correctly managed origins and includes a complete physics and collision detection system. Player progress and settings are stored in the browser’s local storage. The interface automatically adapts to screen size, ensuring a smooth experience on both desktop and mobile. Audio management was custom-built, and the game is structured in modular scenes (preload, menu, game, pause, game over, etc.) for a clear and organized architecture.
Game Scene Structure
PreloadScene: Handles asset loading with a visible progress bar
StartScene: Main menu with game options
LevelSelectScene: Interface for selecting a level
GameScene: Core gameplay scene
PauseScene: Pause menu
GameOverScene: Game over screen
LevelCompleteScene: Level completion celebration
Audio
The game features multiple background music tracks, with some levels having their own specific themes. There are sound effects for actions like shooting or collecting energy, along with ambient music in menus. Music, sound effects, and ambient audio volumes can be adjusted independently.
Local Installation
To run the game locally, simply clone the repository.
Then, install XAMPP (for Windows) or MAMP (for macOS) and launch a local server. Finally, open the index.html
file via the following path:
Game Controls
Arrow keys: Move the character
Mouse click: Shoot fireball
ESC key: Pause the game
S key: Return to level select menu (when paused)
Configuration Options
You can adjust the game’s difficulty (Easy, Medium, Hard), sound volumes (music, effects, ambient), toggle the touchscreen joystick, and configure hitbox size and character speed.
Compatibility
The game has been tested and works properly on all major browsers: Chrome, Firefox, Safari, and Edge.
Mobile Support
The design is fully responsive, featuring touch controls and an on-screen joystick. It supports both landscape and portrait orientations, ensuring a smooth experience on mobile devices as well.
Author: @t2ne
This game was developed as part of an academic project, with the goal of applying game development concepts using modern web technologies.