Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pixelaw/core
Browse files Browse the repository at this point in the history
  • Loading branch information
miko-ov committed Nov 14, 2023
2 parents 0aba42b + e28f914 commit d2407c0
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 81 deletions.
54 changes: 0 additions & 54 deletions bots/PixelBoardBot/uploadBoard.ts

This file was deleted.

13 changes: 13 additions & 0 deletions bots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# PixeLAW Bots
NodeJS processes that handle automation to ensure PixeLAW is updated and moving as expected.
For example, let's take the snake app. A user's snake needs to move every tick. To ensure
that the snake moves without the user having to sign movement transactions every tick,
the move transaction is offloaded to a QueueBot. So in the snake example, the subsequent
snake move transactions are called QueueEvents. They are events that will happen in the
future.

Another process also inside this package is the PixelBoardBot. The PixelBoardBot
saves the current state of all the pixels and puts them in the web directory to be
served up by the front end.


11 changes: 0 additions & 11 deletions bots/lib/aws.ts

This file was deleted.

40 changes: 24 additions & 16 deletions contracts/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Paint
# PixeLAW Contracts
Contracts written in Cairo using Dojo to showcase a Pixel World with app interoperability. Its
interoperability is made possible with core actions. Apps are any other contracts that are deployed
to the Pixel World.

## Overview
## Default Apps
These are apps developed by PixeLAW

## Paint

### Overview
The Paint App is a collection of functions that allow players to manipulate the color of a Pixel.

## Properties
### Properties
None, Paint is just behavior.

## Behavior
### Behavior
- public put_color (color)
- context: position
- both put_fading_color (color)
Expand All @@ -15,19 +23,19 @@ None, Paint is just behavior.
- context: position


# Snake
## Snake

## Overview
### Overview
It it basically the game "snake", but with Pixels not necessarily available to move on/over. It is a player-initialized instance that coordinates pixel's color and text being overriden and reverted (if allowed).
If hitting an unowned Pixel, the snake will move, if Pixel is owned by player, Snake grows, and if Pixel is not owned but it's App allows Snake, it shrinks. In all other cases, Snake dies.

## Properties
### Properties
- position
- color
- text
- direction

## Behavior
### Behavior

- public spawn ( color, text, direction )
- context: position
Expand All @@ -37,28 +45,28 @@ If hitting an unowned Pixel, the snake will move, if Pixel is owned by player, S



# Rock Paper Scissors
## Rock Paper Scissors

## Overview
### Overview
Each Pixel can contain an instance of the RPS App, where it holds a commitment (rock, paper or scissors) from player1. Any other player can now "join" and submit their move. Player1 can then reveal, the winner is decided then. Winner gains ownership of the losing RPS pixel. In case of a draw, the pixel is reset.
The App is also tracking score for each Player.

## Global Properties
### Global Properties
- player+wins

## Game-based Properties
### Game-based Properties
- player1
- player2

## Behavior
### Behavior
- create (position, player1, commit1)
- join (position, player2, move2)
- finish (position, move1, salt1)
- reset (position)


# CommitReveal inputs
## Param of the action
## CommitReveal inputs
### Param of the action
- (Hashed Commit)
- parametername of action has structure: "PREFIX_TYPE_NAME"
- PREFIX is "cr_"
Expand All @@ -68,7 +76,7 @@ The App is also tracking score for each Player.
- parametername of action has structure: "PREFIX_NAME"
- PREFIX shall always be "rv_"
- NAME is the same name user during sending the commit
## Clientside functioning
### Clientside functioning
- If client finds a param starting with "cr_"
- It will prompt user for a param with TYPE
- example:
Expand Down
3 changes: 3 additions & 0 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PixeLAW Web
A vite react web app that acts as UI to the PixeLAW contracts.

0 comments on commit d2407c0

Please sign in to comment.