/bladeofvalor

2D action-adventure game using Phaser 3, Next.js, and a Flask backend with AI-driven chess mechanics.

Where a struggle between humanity and its creations quietly persists, can you possess free will, or are you part of a greater design?

Blade of Valor is a 2D game that combines the power of Phaser 3, Next.js, and a Flask backend to deliver a unique gameplay experience. The game explores themes of free will and the consequences of actions through a storyline inspired by Grimes' 'Player of Games' and aspects of Legend(1985). The protagonist, Elara, navigates a world filled with ghouls, using her skills in sword combat.

Introduction

Blade of Valor is a 2D action-adventure game built using Phaser 3 for the game engine and Next.js for the front-end framework. The game leverages a Flask backend integrated with TensorFlow and Keras to provide AI-driven gameplay mechanics.

Versions

This project includes:

Requirements

  • Node.js
  • Python 3
  • Flask and other Python dependencies (specified in requirements.txt)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/blade-of-valor.git
cd blade-of-valor
  1. Install Node.js dependencies:
npm install
  1. Install Python dependencies:
pip install -r requirements.txt
  1. Start the Flask backend:
cd api
export FLASK_APP=app.py
flask run

The Flask server will run on http://localhost:5000 by default.

  1. Start the Next.js development server:
npm run dev

The development server runs on http://localhost:8080 by default.

Project Structure

  • src/ - Contains the Next.js source code.
  • public/ - Static assets for the game.
  • api/ - Flask backend code.
  • game/ - Phaser game code.

React Bridge

The PhaserGame.tsx component serves as the bridge between React and Phaser. It initializes the Phaser game and manages events between the two.

Backend API

The backend API is built with Flask, TensorFlow, and Keras. It provides AI-driven features for the game, enhancing the overall gameplay experience. The API endpoints are defined in app.py.

Screenshots

Coming soon