Skip to content

Commit

Permalink
license
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Dec 11, 2023
1 parent e63be7e commit d8abc78
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 94 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Dojo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion client/src/dojo/createNetworkLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const createNetworkLayer = async () => {

const { burnerManager, toriiClient, account } = network;

// @dev: This is a hack to get around the fact that the sync manager
// @dev: This is a hack as we have to manually add entities to the world in order to sync.
// this is updated in 0.4.0 into a single line and syncs all the world.
// TODO: remove in 0.4.0
const initial_sync = () => {
Expand Down
177 changes: 84 additions & 93 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,164 +1,155 @@
![image](./.github/image.png)

## Emoji Man
# Emoji Man - 🪨 or 📄 or ✂️

1. Spawn 🪨 or 📄 or ✂️
2. Try and survive. RPS style mechanics.
## Overview

### Resources:
Emoji Man is a game based on Rock-Paper-Scissors (RPS) mechanics where players spawn as one of the following: a Rock 🪨, Paper 📄, or Scissors ✂️. The goal is to survive and thrive using the classic RPS rules.

- [dojobook](https://book.dojoengine.org/)
- [Cairo book](https://github.com/cairo-book/cairo-book.github.io/)
- [discord](https://discord.gg/dojoengine)
- [awesome dojo](https://github.com/dojoengine/awesome-dojo)
## Resources

## Getting started in the Demo
- [Dojo Book](https://book.dojoengine.org/)
- [Cairo Book](https://github.com/cairo-book/cairo-book.github.io/)
- [Dojo Engine Discord](https://discord.gg/dojoengine)
- [Awesome Dojo](https://github.com/dojoengine/awesome-dojo)

## Getting Started with the Demo

### Prerequisites

Install Dojo:
To begin, install Dojo using the following command:

```
```bash
curl -L https://install.dojoengine.org | bash
```

Then run the command:
After installation, run this command to set up:

```
```bash
dojoup
```

Running `dojoup` command will install the latest stable release of the Dojo (as of now [`v0.3.15`](https://github.com/dojoengine/dojo/releases/tag/v0.3.10)) tool suite.

### (Optional) Try out the starter first
This will install the latest stable release of the Dojo tool suite, currently version [`v0.3.15`](https://github.com/dojoengine/dojo/releases/tag/v0.3.10).

`git clone https://github.com/dojoengine/dojo-starter`
### Optional: Starter Project

### Step 1: Init main project
For a foundational start, clone the Dojo starter project:

`git clone https://github.com/dojoengine/emoji-man`
```bash
git clone https://github.com/dojoengine/dojo-starter
```

a. Initialising the project
b. Looking at the project structure
c. Looking at the Scarb
d. Cairo explanation
### Step 1: Initialize the Main Project

### Step 2: Your first model
Clone the Emoji Man project:

a. Thinking about model structure
b. Creating a model and their state structure. 101 on [ECS](https://github.com/SanderMertens/ecs-faq)
c. Dojo is not purely ECS
```bash
git clone https://github.com/dojoengine/emoji-man
```

### Step 3: Your first system
The initial steps include:
a. Project initialization
b. Exploring the project structure
c. Understanding Scarb
d. Introduction to Cairo

a. Creating a system - it's just a contract
b. Adding a new system
c. Run building via `sozo` to test
### Step 2: Creating Your First Model

### Step 4: Adding a new model to a system
Develop your first model by:
a. Conceptualizing the model structure
b. Creating a model and understanding state structures, with insights on [ECS](https://github.com/SanderMertens/ecs-faq)
c. Learning how Dojo is not purely ECS-based

a. Adding a new model
b. Adding a trait!!
c. Using the trait in a system
d. Running build to check
### Step 3: Implementing Your First System

### Step 5: Sozo and the cli
This involves:
a. System creation as a contract
b. Adding a new system
c. Building and testing with `sozo`

a. Deeper into `sozo`
b. Spinning up `katana`
c. Spinning up `torii` and pointing to your World
### Step 4: Integrating a New Model into a System

Checkout out [`sozo`](https://book.dojoengine.org/toolchain/sozo/reference.html), [`katana`](https://book.dojoengine.org/toolchain/katana/reference.html), and [`torii`](https://book.dojoengine.org/toolchain/torii/reference.html) documentations.
Proceed by:
a. Adding a new model
b. Implementing a new trait
c. Utilizing the trait in a system
d. Building and verifying the integration

### Step 6: Clean up
### Step 5: Exploring Sozo and the CLI

a. Clean up of code
Delve deeper into:
a. `sozo` functionalities
b. Launching `katana`
c. Setting up `torii` and connecting to your World

### Step 7: Testing
Refer to the documentation for [`sozo`](https://book.dojoengine.org/toolchain/sozo/reference.html), [`katana`](https://book.dojoengine.org/toolchain/katana/reference.html), and [`torii`](https://book.dojoengine.org/toolchain/torii/reference.html).

a. Testing structure
b. Writing a World deploy test
c. Running the test
### Step 6: Code Cleanup

### Step 8: Deploying to Katana
Focus on:
a. Refining and organizing the code

a. Deploying and debugging
### Step 7: Testing

### Step 8: Client running
Conduct tests by:
a. Establishing a testing structure
b. Writing and executing World deployment tests

a. Running the client
b. Generating models via npm
c. Explaining the client structure - this is just one client, you can have many
d. Explaining `torii` client
### Step 8: Deploying to Katana

### Step 9: New model and syncing
Learn about:
a. Deployment processes and debugging techniques

a. Adding new model to contracts
b. resyncing the client
### Step 9: Running the Client

### Step 10: Spinning up `slot` to deploy `katana` and `torii` instances remotely
Steps include:
a. Launching the client
b. Generating models via npm
c. Understanding client architecture
d. Learning about the `torii` client

a. What is [slot](https://github.com/cartridge-gg/slot)?
### Step 10: Utilizing `slot` for Remote Deployments

Run the following commands to install `slot`:

```
curl -L https://slot.cartridge.sh | bash
```
Understand [slot](https://github.com/cartridge-gg/slot) and its applications. Install `slot` and log in with these commands:

```bash
curl -L https://slot.cartridge.sh | bash
slotup
```

Log in to `slot`:

```bash
slot auth login

# Slot Auth debug (if old auth credentials):
# For old auth credentials debug:
rm ~/Library/Application\ Support/slot/credentials.json
```

b. Deployin
Deployment steps:

```bash
# Create and manage deployments
slot deployments create emoji-man-demo katana

# get credentials and save in Scarb.toml
# Retrieve and save credentials
slot deployments logs emoji-man-demo katana -f

# build a release
# Build and migrate releases
sozo --release build

# migrate release to katana
sozo --release migrate

# setup torri and point to the world
# Set up torii and connect to the world
slot deployments create emoji-man-demo torii --rpc https://api.cartridge.gg/x/emoji-man-demo/katana --world 0x1fad58d91d5d121aa6dc4d16c01a161e0441ef75fe7d31e3664a61e66022b1f --start-block 1

# set auth (you will need to update the rpc_url to match your release)
# Update authentication for the release
./scripts/default_auth.sh release
```

d. Deploying a client to vercel - `use your own vercel account`
### Step 11:

de. Multiplayer - share live link
Deploy to vercel.

## Next Steps

### Bonus 1: Optimistc Rendering

- Use RECS optimisc rendering to render the player in the client before the tx is confirmed

### Bonus 2: Show energy levels in the client

- Use RECS to show the energy levels in the client
### Bonus 1: Add a collectables

### Bonus 3: Noise in map in Cairo and in Client

- Use [cubit](https://github.com/influenceth/cubit) simplex noise to restrict movement over mountains
- [noise](https://github.com/influenceth/sdk/blob/master/src/utils/simplex.js)
- Add a way to spawn collectables on the map and allow players to collect them

### Bonus 4: Add a collectables
### Bonus 2: Leaderboard

- Add a way to spawn collectables on the map and allow players to collect them
- Add UI in client to show total amount of killed types.

0 comments on commit d8abc78

Please sign in to comment.