Skip to content

Top-down shooter demonstration project using Colyseus 0.14.0 and Cocos Creator 3.4.2.

License

Notifications You must be signed in to change notification settings

Hashish-Crypto/top-down-shooter-server

Repository files navigation

Top-down shooter - Cocos Creator & Colyseus - Server

Top-down shooter demonstration project using Colyseus 0.14.0 and Cocos Creator 3.4.2.

Live demo: acquati.itch.io/top-down-shooter-client

Move with "A,W,S,D" keyboard keys, with the on screen joystick or with a controller directional pad.

This project has been created using ⚔️ create-colyseus-app - an npm init template for kick starting a Colyseus project in TypeScript.

Documentation

Running the server locally

git clone https://github.com/Hashish-Crypto/top-down-shooter-server.git
cd top-down-shooter-server
npm install
npm start

Running the client locally

git clone https://github.com/Hashish-Crypto/top-down-shooter-client.git
cd top-down-shooter-client
npm install

Open Cocos Dashboard and add this project.

Prerequisites for development

Install Cocos Creator cocos.com/en/creator/download

Install Visual Studio Code: code.visualstudio.com/download

Install Git Bash: git-scm.com/download/win

Install nvm-windows, choose nvm-setup.zip: github.com/coreybutler/nvm-windows/releases

Open Git Bash as system administrator:

# Install Node and NPM
nvm install latest
nvm current
nvm use 18.0.0
node -v
npm -v

Structure

  • index.ts: main entry point, register an empty room handler and attach @colyseus/monitor
  • src/rooms/MyRoom.ts: an empty room handler for you to implement your logic
  • src/rooms/schema/MyRoomState.ts: an empty schema used on your room's state.
  • loadtest/example.ts: scriptable client for the loadtest tool (see npm run loadtest)
  • package.json:
    • scripts:
      • npm start: runs ts-node-dev index.ts
      • npm test: runs mocha test suite
      • npm run loadtest: runs the @colyseus/loadtest tool for testing the connection, using the loadtest/example.ts script.
  • tsconfig.json: TypeScript configuration file

License

MIT

About

Top-down shooter demonstration project using Colyseus 0.14.0 and Cocos Creator 3.4.2.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published