Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dojoengine/stark-lander
https://github.com/dojoengine/stark-lander
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dojoengine/stark-lander
- Owner: dojoengine
- License: mit
- Created: 2023-07-01T00:30:31.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-31T12:04:11.000Z (9 months ago)
- Last Synced: 2024-08-04T01:11:37.772Z (4 months ago)
- Language: TypeScript
- Size: 583 KB
- Stars: 12
- Watchers: 2
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starknet - Stark-lander
README
---
[![discord](https://img.shields.io/badge/join-dojo-green?logo=discord&logoColor=white)](https://discord.gg/PwDa2mKhR4)
[![Telegram Chat][tg-badge]][tg-url][tg-badge]: https://img.shields.io/endpoint?color=neon&logo=telegram&label=chat&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fdojoengine
[tg-url]: https://t.me/dojoengine## Stark Lander
An onchain interpretation of the classic game [Lunar Lander](https://en.wikipedia.org/wiki/Lunar_Lander_(video_game_genre)). Try and land on the ground with a velocity of 0.1m/s. All computation is calculated in [Cairo](https://book.cairo-lang.org/title-page.html) and the game is built using the Dojo engine.
### Systems
- `Start`: Spawns a Lander with some random coordinates
- `Burn`: Adjusts the trajectory of the Lander according to inputs
- `Position`: Returns live position of the Lander
- `Win`: Create Win condition### Components
- `Lander`: Lander state and computed values
- `Fuel` : TODO: abstract from Lander component### 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
```console
git clone https://github.com/dojoengine/stark-lander.git
```### Install Dojo
```console
curl -L https://install.dojoengine.org | bashdojoup
```## Running the game
### Katana
Run Katana in a terminal window using the following command:```console
katana --allow-zero-max-fee --block-time 1
```### Contract
Switch to a new terminal window and run the following commands:```console
cd contractsozo build // Build World
sozo migrate // Migrate World
```### Client
In another terminal window, start the client server by running the following command:```console
cd clientyarn
yarn dev
```