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.
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
Lander
: Lander state and computed valuesFuel
: TODO: abstract from Lander component
- 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
git clone https://github.com/dojoengine/stark-lander.git
curl -L https://install.dojoengine.org | bash
dojoup
Run Katana in a terminal window using the following command:
katana --allow-zero-max-fee --block-time 1
Switch to a new terminal window and run the following commands:
cd contract
sozo build // Build World
sozo migrate // Migrate World
In another terminal window, start the client server by running the following command:
cd client
yarn
yarn dev