|
| 1 | +# Tron |
| 2 | +AI controlled Tron / Snake like game |
| 3 | + |
| 4 | +### How to play |
| 5 | +- Localy |
| 6 | +```sh |
| 7 | +git clone https://github.com/nan-academy/tron.git |
| 8 | +cd tron |
| 9 | + |
| 10 | +# from here you can just serv the files: |
| 11 | +http-server |
| 12 | + |
| 13 | +# if you don't have http-server installed: |
| 14 | +npm install -g http-server |
| 15 | +``` |
| 16 | + |
| 17 | +- Online, just open [nan-academy.github.io/tron](https://nan-academy.github.io/tron?users=random,random) |
| 18 | + |
| 19 | +### Rules |
| 20 | +- You have to move every turn *(you can't stay still)* |
| 21 | +- Every time you move somewhere you leave a color trail. |
| 22 | +- You can only move to a blank tile |
| 23 | +- You can't move out of the map *(100 x 100)* |
| 24 | +- You can only move to your `left`, `up` or `right`. |
| 25 | + *(Moving `backward` is suicide as you hit your own trail !)* |
| 26 | +- If you take to much CPU to decide where to go, you die |
| 27 | +- If two players moved to the same spot, they both die |
| 28 | +- **Survive as long as you can.** |
| 29 | + |
| 30 | +### End of the game |
| 31 | +- Once no players can make a move |
| 32 | +- The player with the longest trail wins |
| 33 | + |
| 34 | +### Controls |
| 35 | +- `space` toogle autoplay |
| 36 | +- `right arrow` play one move |
| 37 | +- `up arrow` increase autoplay speed |
| 38 | +- `down arrow` lower autoplay speed |
| 39 | +- `R` reload the same play |
| 40 | +- `S` load a new play (new seed) |
| 41 | + |
| 42 | +### How to write your AI |
| 43 | +- Copy the file [/ai/random.js](https://github.com/nan-academy/tron/blob/master/ai/random.js) to /ai/**GITHUB_LOGIN**.js |
| 44 | +- You may now edit the `update` function which is called each turn |
| 45 | + |
| 46 | +### Publish your AI |
| 47 | +- Fork this repo |
| 48 | +- Create file that use your github login as filename in the /ai/ folder |
| 49 | +- Push that to master and your are done |
| 50 | + |
0 commit comments