AI controlled Tron / Snake like game
- Localy
git clone https://github.com/nan-academy/tron.git
cd tron
# from here you can just serv the files:
http-server
# if you don't have http-server installed:
npm install -g http-server
- Online, just open nan-academy.github.io/tron
- You have to move every turn (you can't stay still)
- Every time you move somewhere you leave a color trail.
- You can only move to a blank tile
- You can't move out of the map (100 x 100)
- You can only move to your
left
,up
orright
. (Movingbackward
is suicide as you hit your own trail !) - If you take to much CPU to decide where to go, you die
- If two players moved to the same spot, they both die
- Survive as long as you can.
- Once no players can make a move
- The player with the longest trail wins
space
toogle autoplayright arrow
play one moveup arrow
increase autoplay speeddown arrow
lower autoplay speedR
reload the same playS
load a new play (new seed)
- Copy the file /ai/nan-academy.js to /ai/GITHUB_LOGIN.js
- You may now edit the
update
function which is called each turn
- Fork this repo
- Create file that use your github login as filename in the /ai/ folder
- Push that to master and your are done