Magica is a 2D RPG adventure game built from scratch using vanilla JavaScript, HTML5 Canvas, and CSS. Explore a vast world, battle enemies, and uncover the secrets hidden within the realm of Magica!
- Dynamic Gameplay: Experience a classic 2D RPG with a top-down perspective, featuring a rich and interactive world.
- Responsive Design: Play on any screen size, from desktops to mobile devices.
- Pub/Sub Architecture: A robust event-driven system manages game logic, ensuring a modular and scalable codebase.
- Expansive World: Explore over 20+ unique in-game locations, each with its own set of design and challenges.
- Engaging Story: Immerse yourself in a captivating narrative with the quest.
- Multiple Weapons: Choose from a variety of weapons to suit your playstyle (only one melee and range at a time).
- Challenging Enemies: Face a diverse range of enemies, each with varing hitpoints and range.
- Movement: Control the player using the WASD or arrow keys.
- Combat: Attack enemies with your equipped weapon using the spacebar.
- Heal: Heal characters hitpoints by pressing the "Z" key.
- Swap Weapons: Use Shift to swap weapons form range to melee or vice-versa.
- JavaScript (ES6+): The core game logic is written in modern JavaScript.
- HTML5 Canvas: Renders all graphics and animations.
- CSS3: Styles the UI and game elements.
- Vite: A fast and lightweight development server and build tool.
- Bun: A modern JavaScript runtime and package manager.
/
โโโ public/ # Static assets (images, sounds, etc.)
โโโ src/ # Source code
โ โ
โ โโโ abjecentLists/ # contains map specific data
โ โโโ classes/ # Game object classes
โ โโโ constants/ # Game constants (directions, health, etc.)
โ โโโ meta/ # Infomation about game objects
โ โโโ store/ # States
โ โโโ ui/ # UI components
โ โโโ util/ # Utility functions
โ โ
โ โโโ main.js # Entry point
โ โโโ eventListenera.js # All the pub/sub logic
โ โโโ updateLoop.js # Game eventloop
โ โโโ menu.js # Ui elements logic
โ โโโ declare.js # init objects
โ
โโโ index.html # Main HTML file
โโโ package.json # Project dependencies
-
Clone the repository:
git clone https://github.com/SamTheTechi/magica.git cd magica -
Install dependencies:
bun install # or npm install -
Start the Development Server:
bun run dev # or bun run dev
Then open http://localhost:5173 in your browser.
This project is licensed under the MIT License. See the LICENSE file for details.
- All assets used in this project are from itch.io.
- The game is inspired by the classic "The Legend of Zelda" series.
Made with โค๏ธ by Sameer Gupta
