Skip to content

SerhiiChoGames/tower-defense

Repository files navigation

Tower Defense Game

Tower Defense Game

Open source game written with Phaser JS where you need to build towers to kill the monsters they will try to destroy your castle.

Warning

The game is not finished yet, but you can play it here

Installation

The project is written with Phaser JS and Vite. To run the project locally, follow the steps below:

  1. Clone the repository
  2. Navigate to the project directory
  3. Run npm install to install the dependencies
  4. Run npm run dev to start the development server

License

The project is licensed under the MIT License

Contribute

NPM Commands

If you a container engine, do these commands inside of a container.

Install Dependencies

npm i

Watch File Changes

npm run dev

Navigate to http://localhost:5173/tower-defense/ to see your documentation if you run project locally. For containers, visit http://localhost:3000/tower-defense/.

With Container Engine

If you use a container engine like 🦦 Podman or 🐳 Docker, here are the steps that you can make:

Build an Image

To build an image, navigate to the root of the project and run this command for Docker:

docker compose build

For Podman, run this:

podman-compose build

Run the Container

To run a container, navigate to the root of the project and run this command for Docker:

docker compose up -d

For Podman, run this:

podman-compose up -d

You can visit http://localhost:3000/tower-defense/ to see the game running in container.

Copy node_modules Locally

To copy node_modules directory from the container to your local machine, run this command for Docker:

docker cp ago-docs:/app/node_modules .

For Podman, run this:

podman cp ago-docs:/app/node_modules .

Note

node_modules is excluded from using volume in compose.yml file, that's why you need to copy it manually. It's done to prevent your local modules to be copied to Linux container, since it can create incompatibility issues between operating systems if you don't use Linux.

Enter the Container

To enter inside of the container, run this command for Docker:

docker compose exec app sh

For Podman, run this:

podman-compose exec app sh

You'll be able to run NPM commands inside of the container.

Remove the Container

Run this for Docker:

docker compose down

For Podman, run this:

podman-compose down

About

Open source game written with Phaser JS where you need to build towers to kill the monsters they will try to destroy your castle

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages