https://github.com/nullobject/flatland
https://github.com/nullobject/flatland
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nullobject/flatland
- Owner: nullobject
- Created: 2013-06-24T10:44:42.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-26T02:50:19.000Z (almost 12 years ago)
- Last Synced: 2024-12-28T04:46:47.873Z (about 1 year ago)
- Language: Objective-C
- Size: 777 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flatland
Flatland is a multi-player game where each player is controller by actions sent
over HTTP.
## Actions
Every action costs the player a set amount of energy points.
All requests must include the `X-Player` header. The server will respond with
the world view for the player.
{
player: {...}
}
### Spawn
Spawns the player in the world.
For example:
`curl -i -X PUT -H 'X-Player: 5108B670-3332-4172-862D-89BF68576ED6' -H 'Content-Type: application/json' -d '' http://localhost:8000/player/spawn`
### Rest
Rests the player for a given amount of time, where amount is a value between
-1.0 and 1.0. The player restores 10 energy points for each tick of the world
clock.
For example:
`curl -i -X PUT -H 'X-Player: 5108B670-3332-4172-862D-89BF68576ED6' -H 'Content-Type: application/json' -d '{"amount":1.0}' http://localhost:8000/player/rest`
### Move
Moves the player in the direction they are facing by a given amount, where
amount is a value between -1.0 and 1.0. The player uses 20 energy points for
moving.
For example:
`curl -i -X PUT -H 'X-Player: 5108B670-3332-4172-862D-89BF68576ED6' -H 'Content-Type: application/json' -d '{"amount":1.0}' http://localhost:8000/player/move`
### Turn
Turns the player by a given amount, where amount is a value between -1.0 and
1.0. The player uses 20 energy points for turning.
For example:
`curl -i -X PUT -H 'X-Player: 5108B670-3332-4172-862D-89BF68576ED6' -H 'Content-Type: application/json' -d '{"amount":1.0}' http://localhost:8000/player/turn`