README.md
July 19, 2023 ยท View on GitHub
Stark Lander
An onchain interpretation of the classic game Lunar Lander. Try and land on the ground with a velocity of 0.1m/s. All computation is calculated in Cairo and the game is built using the Dojo engine.
Systems
Start: Spawns a Lander with some random coordinatesBurn: Adjusts the trajectory of the Lander according to inputsPosition: Returns live position of the LanderWin: Create Win condition
Components
Lander: Lander state and computed valuesFuel: TODO: abstract from Lander component
Game loop
- Players spawn a lander with
start - Input thrust and angle on each action
- Compute position according to block and tick forward at constant rate
- Determine if lander arrives at surface of planet at the correct angle and correct speed
Pre-requisites
Clone
git clone https://github.com/dojoengine/stark-lander.git
Install Dojo
curl -L https://install.dojoengine.org | bash
dojoup
Running the game
Katana
Run Katana in a terminal window using the following command:
katana --allow-zero-max-fee --block-time 1
Contract
Switch to a new terminal window and run the following commands:
cd contract
sozo build // Build World
sozo migrate // Migrate World
Client
In another terminal window, start the client server by running the following command:
cd client
yarn
yarn dev