Home

Awesome

<img alt="Dojo logo" src=".github/lander.png">
<picture> <source media="(prefers-color-scheme: dark)" srcset=".github/mark-dark.svg"> <img alt="Dojo logo" align="right" width="120" src=".github/mark-light.svg"> </picture> <a href="https://twitter.com/dojostarknet"> <img src="https://img.shields.io/twitter/follow/dojostarknet?style=social"/> </a> <a href="https://github.com/dojoengine/dojo"> <img src="https://img.shields.io/github/stars/dojoengine/dojo?style=social"/> </a>

discord Telegram Chat

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

Components

Game loop

  1. Players spawn a lander with start
  2. Input thrust and angle on each action
  3. Compute position according to block and tick forward at constant rate
  4. 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