Multiplayer FCS written in Three.js, SocketIO and with client and server side CannonJS physics.
Playable Demo : https://fcs.sbcode.net
This is an experiment with,
- spherical gravity
- some CannonJS physics calculated server side, everything else calculated client side
- uses CANNON.Trimesh for ground topography
- multiplayer using SocketIO
- sfx with THREE.AudioListener
- 10 points for shooting moons
- 100 points for shooting other players
- Drive : WASD
- Brakes : SPACE
- Look : MOUSE
- Shoot : Left Mouse Click
- Respawn : R
- Left XY Controller : Drive, Tap to shoot
- Right XY Controller : Look, Aim, Tap to shoot
- Clone Repository
git clone https://github.com/Sean-Bradley/First-Car-Shooter.git
- CD into folder
cd First-Car-Shooter
- Install TypeScript
npm install -g typescript
- Install dependencies
npm install
- Start it
npm run dev
- Visit http://127.0.0.1:8080
See start screen instructions for commands to Drive, Aim and Shoot
- Edit project in VSCode
code .
- Build webpack production version.
npm run build
- Compile nodejs server script
tsc -p ./src/server
- Start
npm start
- Visit http://127.0.0.1:3000
Server script uses Express and SocketIO on port 3000
For more in depth information on some deployment options, such as SSL, Domain name & Cloud hosting, visit https://sbcode.net/threejs/nginx-host/
To help support my free projects, please take a look at my ThreeJS and TypeScript Book
https://www.amazon.com/dp/B09GYTKRCH
https://www.amazon.co.uk/dp/B09GYTKRCH
https://www.amazon.in/dp/B09GYTKRCH
https://www.amazon.de/dp/B09GYTKRCH
https://www.amazon.fr/dp/B09GYTKRCH
https://www.amazon.es/dp/B09GYTKRCH
https://www.amazon.it/dp/B09GYTKRCH
https://www.amazon.nl/dp/B09GYTKRCH
https://www.amazon.co.jp/dp/B09GYTKRCH
https://www.amazon.ca/dp/B09GYTKRCH
https://www.amazon.com.br/dp/B09GYTKRCH
https://www.amazon.com.mx/dp/B09GYTKRCH
https://www.amazon.com.au/dp/B09GYTKRCH
and my ThreeJS and TypeScript courses at Udemy, YouTube (Channel membership required) and Skillshare
This is only just the beginning of what you will create.
Course Discount Coupons : https://sbcode.net/coupons#threejs