- Loom Cocos SDK
- Generate Cocos SDK
- Install Loom
- Install Cocos Creator
- Integrate to Creator Game
Loom Cocos SDK
Loom global structure diagram
Loom Cocos SDK structure diagram
Loom-Cocos-SDK have same api, same protobuf, similar contract with
Loom Cocos SDK is based on Loom-JS , and porting it to
Cocos Creator .
Generate Cocos SDK
git clone https://github.com/loomnetwork/cocos-sdk.git
git submodule update --init, update git submodule
Loom SDK for Cocos Creator is the directory
loom-cocos-sdk, which is generated by command
wget https://private.delegatecall.com/loom/osx/stable/loom chmod +x loom mkdir tmpgopath export GOPATH=`pwd`/tmpgopath ./loom spin weave-blueprint cd blueprint export GOPATH=$GOPATH:`pwd` make deps make cd build ../../loom init cp ../genesis.example.json genesis.json
# unable to start http server: listen tcp 127.0.0.1:9092: bind: address already in use pkill blueprint # kill server first ../../loom run
Please consult the Loom SDK docs for further instruction on running your own DappChain.
Install Cocos Creator
Cocos Creator is a complete package of game development tools and workflow, including a game engine (based on Cocos2d-x), resource management, scene editing, game preview, debug and publish one project to multiple platforms.
Cocos Creator provides an innovative, easy to use toolset such as the UI system and Animation editor. The toolset will be expanding continuously and quickly, thanks to the open editor extension system.
you can download
Cocos Creator from here , and install.
Integrate to Creator Game
- copy the generated
Loom Cocos SDKto your project's
asset/scriptdirectory, and rename it to
- write your own
protofile as requirements of your game e.g.
sample/loomDemoForCreatoruse setscore.proto, and related setscore_pb.js
- write yur own contract as requirements of your game, and serailezse your data with
setscore_pb.js, and send to Loom Blockchain, take a look at SimpleContract
- invoke api of your contract at suitable position.
There are two
loomDemoForCreatorsimplely use loom sdk
dark-slashuse loom sdk in a real game
- update git submodule, run command
git submodule update --init, if you have done this, skip this.
- generate and pack
Loom Cocos SDK, run command
Loom Cocos SDKto
sample/dark-slash, run command
- entry directory
Loom Block Chainservices, run command
../../loom run, if you have done this, skip this.
Cocos Creatorand run