First of all, survive. Attack: close combat, range attacks, surprises. Defend, avoid getting hit, look for items and score points. After a limited number of rounds, the game ends and a living beaver with the max points wins.
-
Build the game contract
yarn build
-
Start backend node.js server (Only if you prefer websockets, otherwise skip it)
yarn dev
-
Start local static http server, e.g.
yarn serve
-
Open the game at
http://localhost:9001/
In order to deploy and spawn along with games:
yarn deploy-session:local 23:20
or
node js/tools/deploy-spawn-session.js --env local --time 23:20
Games config can be found in of multiple json configuration files, for example
./tools/deploy/config/session-local-ao.json
In order to deploy and spawn a single game to the existing hub
yarn deploy-session-game:local 23:20
or
node js/tools/deploy-spawn-session-game.js --env local --time 23:20
Omitting date in the commands above will result in spawning games without time limits
In order to use jnio wallet in aos update the $HOME/.aos.json
In lua directory run
aos CyberBeaversToken
.load token.lua
Send({ Target = ao.id, Tags = { Action = "Transfer", Recipient = 'ksovq4pOatEoWzbxe8Iu8xeuhQshnoSpbKZ0TcDlMko', Quantity = '1000000' }})
Send({ Target = ao.id, Tags = { Action = "Balances" }})
Game slot lasts 6 minutes
- 5 minutes game
- 1-minute break During break, first 30 seconds is Leaderboard. Second 30 seconds is lounge area.
Every six minutes a cron is triggered which executes deploy scripts. Deployment is as follows:
- Build contract
- Deploy new game contract and spawn it
- Transfer tokens to game process
- Set up game config, game start and end
- Deploy new chat contract
Only a limited number of players can access the game. Before the game begins there is a queue for players to register.
Maps are created using the Tiled editor. In order to create a new map:
- Download and install the editor.
- Clone this repository (
git clone git@github.com:warp-contracts/cyberpunk-beavers.git
) or simply download it as a zip file from https://github.com/warp-contracts/cyberpunk-beavers - Go to
<your_path>/cyberpunk-beavers/public/assets/maps/v2/
directory. - Open the
b1m1.tmx
file. - The
Tiled
editor should open, and you should see something similar to:
The main areas of the editor are:
- Editor area - this is a place, where you build you map - i.e. put tiles from a specific tileset on a specific layer
- Layers area - these are the layers that are defined for each map.
- Tilesets area - these are tilesets that are meant to be used wihtin layers
- Select the
sand
in theLayers
section - Select the whole map in the editor (
cmd+a
on Mac) - Remove all the selected tiles (
backspace
on Mac) You should end-up with something similar to: - Repeat the above steps for all the other layers
NOTE: you can also start with simply editing the template - which is probably a better idea at start.
- Select the
sand
in theLayers
- Select on of the tiles - e.g. the "light sand" tile (which is at the bottom of the tileset).
- Place it on the layer using the
Stamp Brush
tool
NOTE Get familiar with other tools available, especially -Bucket Fill Tool
,Shape Fill Tool
,Eraser
... More details can be found here. - Add more elements to the other layers - remember that you can also rotate/flip the existing tiles.
You can create any amount of layers with any names you like.
The only rule is that there has to be a layer named collissions
- where you have to mark (using any tile - we usually
use the 'warning sign' tile) parts of the map that are considered as obstacles and are not accessible for the players
(e.g. the buildings, barrels, signs, etc...).
Assuming that you're happy with the results - it's time to export your map.
Save it first as a new file - File->Save As...
.
Then go to File->Export As...
, set a proper name (e.g. b1m10.json
), file location and choose the JSON map files
format.
The exported file should like similar to:
Having the map exported, we can now post it to Arweave. You can do however you want to do it, an example script that is using Turbo bundler is here. If you want to use the above script:
- set the
file
and themapName
variables.
- put your wallet in the
.secrets
directory - run the script using node.js
node tools/create-map-tx.js
. You should see sth similar to a result:
- After posting the map to Arweave, please share your results on our Discord (i.e. the transaction id from the response in previous point and a screenshot of the map itself) - if it has interesting design and is formally correct - we might use it the game!
NOTE: if you're manually posting the map to Arweave, be sure to add these tags:
[
{
"name": "Data-Protocol",
"value": "warp-beavers-map"
},
{
"name": "Name",
"value": "<your-map-name>"
},
{
"name": "Map-Api-Version",
"value": "v2"
},
{
"name": "Terrain",
"value": "desert"
}
]