Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init #46

Merged
merged 59 commits into from
Nov 10, 2023
Merged

init #46

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
8fc64b5
init
ponderingdemocritus Nov 8, 2023
3178661
update phasher
ponderingdemocritus Nov 8, 2023
e7973e1
add nested dir
ponderingdemocritus Nov 8, 2023
c7ae666
add sync
ponderingdemocritus Nov 8, 2023
0f093b3
add sync
ponderingdemocritus Nov 8, 2023
a8ca17e
inital packages
ponderingdemocritus Nov 8, 2023
5b68472
examples: emojiman contracts
shramee Nov 9, 2023
4af5f0d
Merge pull request #47 from shramee/dev-connect
ponderingdemocritus Nov 9, 2023
94b61fe
feat: moves queue
shramee Nov 9, 2023
fee87ed
Merge pull request #48 from shramee/dev-connect
ponderingdemocritus Nov 9, 2023
04ad2f4
example
ponderingdemocritus Nov 9, 2023
6e69af2
Merge branch 'dev-connect' of https://github.com/dojoengine/packages …
ponderingdemocritus Nov 9, 2023
388c0f4
chore: dir pop
shramee Nov 9, 2023
cbb2532
Merge pull request #49 from shramee/dev-connect
ponderingdemocritus Nov 9, 2023
a0d1c85
integrate mon
ponderingdemocritus Nov 9, 2023
484a6e1
Merge branch 'dev-connect' of https://github.com/dojoengine/packages …
ponderingdemocritus Nov 9, 2023
7727962
feat: player components
shramee Nov 9, 2023
7470e43
Merge pull request #50 from shramee/dev-connect
ponderingdemocritus Nov 9, 2023
4caeb8a
start refactor
ponderingdemocritus Nov 9, 2023
67b09e6
Merge branch 'dev-connect' of https://github.com/dojoengine/packages …
ponderingdemocritus Nov 9, 2023
58638d3
feat: instant moves
shramee Nov 9, 2023
fb2e74b
textures phaser
ponderingdemocritus Nov 9, 2023
cf1646e
Merge pull request #51 from shramee/dev-connect
ponderingdemocritus Nov 9, 2023
b7b8344
Merge branch 'dev-connect' of https://github.com/dojoengine/packages …
ponderingdemocritus Nov 9, 2023
f8fcb89
add moves
ponderingdemocritus Nov 9, 2023
41013d1
feat: position index
shramee Nov 9, 2023
4c7f0be
Merge pull request #52 from shramee/dev-connect
ponderingdemocritus Nov 9, 2023
10169af
tweak: new component and org
shramee Nov 10, 2023
c493d19
Merge pull request #53 from shramee/dev-connect
ponderingdemocritus Nov 10, 2023
2537fa0
client work
ponderingdemocritus Nov 10, 2023
bbc418c
Merge branch 'dev-connect' of https://github.com/dojoengine/packages …
ponderingdemocritus Nov 10, 2023
0fd9958
update client
ponderingdemocritus Nov 10, 2023
f9b0b0a
client
ponderingdemocritus Nov 10, 2023
79a30d1
feat: encounter
shramee Nov 10, 2023
038c3ed
Merge pull request #54 from shramee/dev-connect
ponderingdemocritus Nov 10, 2023
9a5ab1f
move account around
ponderingdemocritus Nov 10, 2023
29f7d8f
move packages
ponderingdemocritus Nov 10, 2023
e782432
fix sync
ponderingdemocritus Nov 10, 2023
85a59af
remove dead code
ponderingdemocritus Nov 10, 2023
b551334
bump torii-wasm
kariy Nov 10, 2023
4faef07
fix: 0 energy is okay
shramee Nov 10, 2023
b920985
energise ⚡️
shramee Nov 10, 2023
f3a1194
Merge pull request #55 from shramee/dev-connect
ponderingdemocritus Nov 10, 2023
0781c22
update
ponderingdemocritus Nov 10, 2023
5ef48a1
fix max energy
shramee Nov 10, 2023
2e2ceb4
Merge pull request #56 from shramee/dev-connect
ponderingdemocritus Nov 10, 2023
10d9872
Merge branch 'dev-connect' of https://github.com/dojoengine/packages …
ponderingdemocritus Nov 10, 2023
1086d94
sync
ponderingdemocritus Nov 10, 2023
9f50883
feat: random spawn on empty tile
shramee Nov 10, 2023
e6d1084
Merge pull request #57 from shramee/dev-connect
ponderingdemocritus Nov 10, 2023
06cd5f4
revert location
ponderingdemocritus Nov 10, 2023
6966f8d
contract
ponderingdemocritus Nov 10, 2023
fff7fc0
listen to changes
kariy Nov 10, 2023
b5eac2b
feat: kill the dead
shramee Nov 10, 2023
8792f7f
Merge branch 'dev-connect' into dev-connect
shramee Nov 10, 2023
f206ccb
Merge pull request #58 from shramee/dev-connect
ponderingdemocritus Nov 10, 2023
5539ae0
fix player
ponderingdemocritus Nov 10, 2023
ab22e26
phasher systems
ponderingdemocritus Nov 10, 2023
ea4b8f1
client work
ponderingdemocritus Nov 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
4 changes: 4 additions & 0 deletions examples/emojiman/.github/mark-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions examples/emojiman/.github/mark-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions examples/emojiman/.github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI

on:
push:
pull_request:

jobs:
sozo-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: curl -L https://install.dojoengine.org | bash
- run: /home/runner/.config/.dojo/bin/dojoup -v v0.3.2
- run: |
/home/runner/.config/.dojo/bin/sozo build
/home/runner/.config/.dojo/bin/sozo test
1 change: 1 addition & 0 deletions examples/emojiman/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
5 changes: 5 additions & 0 deletions examples/emojiman/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cairo1.languageServerPath": "$HOME/.dojo/bin/dojo-language-server",
"cairo1.enableLanguageServer": true,
"cairo1.enableScarb": false
}
21 changes: 21 additions & 0 deletions examples/emojiman/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.
29 changes: 29 additions & 0 deletions examples/emojiman/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<picture>
<source media="(prefers-color-scheme: dark)" srcset=".github/mark-dark.svg">
<img alt="Dojo logo" align="right" width="80" src=".github/mark-light.svg">
</picture>

![Turn based](https://img.shields.io/badge/Turn_based-8A2BE2)
![Rock paper scissors](https://img.shields.io/badge/Rock_Paper_Scissors-blue)
# Emojiman contracts

Player can be of type of rock/paper/scissors.
Players spawn on a 50 x 50 grid. Make 3 moves per turn. And try to kill as many as they can before getting killed. A kill happens when two players land on the same tile, regular RPS mechanics. Two players of same type can exist on the same tile.

## Data

* Player ID
* Position
* Energy
* Type
* ContractAddress

## Actions

* Spawn
- Assigns a player ID and spawns the contract address.
* Move
- Submit 3 directions you want to move to.
* Tick
- Runs the game turn processing all submitted moves.
- Kills the players of different type on same tile.
21 changes: 21 additions & 0 deletions examples/emojiman/Scarb.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "dojo"
version = "0.3.4"
source = "git+https://github.com/dojoengine/dojo?tag=v0.3.4#a3140d88b08b79c5ff2261c1db81bafe80b5cc91"
dependencies = [
"dojo_plugin",
]

[[package]]
name = "dojo_examples"
version = "0.3.7"
dependencies = [
"dojo",
]

[[package]]
name = "dojo_plugin"
version = "0.3.6"
21 changes: 21 additions & 0 deletions examples/emojiman/Scarb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
cairo-version = "2.2.0"
name = "dojo_examples"
version = "0.3.7"

[cairo]
sierra-replace-ids = true

[dependencies]
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.4" }

[[target.dojo]]

[tool.dojo]
initializer_class_hash = "0xbeef"

[tool.dojo.env]
rpc_url = "http://localhost:5050/"
# Default account for katana with seed = 0
account_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"
private_key = "0x1800000000300000180000000000030000000000003006001800006600"
24 changes: 24 additions & 0 deletions examples/emojiman/scripts/default_auth.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -euo pipefail
pushd $(dirname "$0")/..

export RPC_URL="http://localhost:5050";

export WORLD_ADDRESS=$(cat ./target/dev/manifest.json | jq -r '.world.address')

export ACTIONS_ADDRESS=$(cat ./target/dev/manifest.json | jq -r '.contracts[] | select(.name == "actions" ).address')

echo "---------------------------------------------------------------------------"
echo world : $WORLD_ADDRESS
echo " "
echo actions : $ACTIONS_ADDRESS
echo "---------------------------------------------------------------------------"

# enable system -> component authorizations
COMPONENTS=("Position" "MovesQueue" "RPSType" "GameData" "PlayerID" "Energy" "PlayerAddress" "PlayerAtPosition" )

for component in ${COMPONENTS[@]}; do
sozo auth writer $component $ACTIONS_ADDRESS --world $WORLD_ADDRESS --rpc-url $RPC_URL
done

echo "Default authorizations have been successfully set."
Loading
Loading