Princess & Protector Header

Princess & Protector

Endless Game with Leveling & Shop Mechanics

Princess & Protector is a top-down 2D game built with Phaser. This project includes a leveling system, a functioning in-game shop, and basic movement/combat mechanics. If you're looking to learn Phaser or just want a fun little codebase to experiment with, Princess & Protector offers a quick example of a hack-n-slash style game!

TRY IT ONLINE

Spin up your own copy on Heroku, Repl.it, or check it out on Itch.io:

Deploy on HerokuRun on Repl.itPlay on Itch.io

HOW IT WORKS

The leveling system increments player stats (health, damage, etc.) upon defeating enemies or collecting experience points, which in turn spawns harder enemies, who drop more coins. The in-game shop allows the player to purchase weapon upgrades and more health, with the endless cycle continuing for over 50 different weapon types and 30 different enemies.

The project includes a lightweight asset pipeline for sprite sheets, tilemaps, and audio. For example, the main character sprite is a simple PNG with multiple frames for walking animations, while enemies are similarly loaded from sprite sheets for movement and idle animations. Collision and movement are handled via Phaser's built-in physics and tile-based collision layers in the tilemap.

GALLERY

Princess & Protector Screenshot 1Princess & Protector Screenshot 2Princess & Protector Screenshot 3Princess & Protector Screenshot 4

CONCLUSION

Princess & Protector is a small demonstration of Phaser's capabilities for 2D top-down games, which shows how one can easily implement scalable mechanics. Between the leveling system, shop, and straightforward hack-and-slash mechanics, it can be a great starting point for a larger project. Poke around the source code to experiment with your own features and customizations!