Giter VIP home page Giter VIP logo

castledice-frontend's Introduction

Castledice-frontend

Try it out: https://near.org/ostolex.near/widget/CastleDice Menu and loading screen background

Project structure and links

Project structure:

  1. This repo with game's front-end written with Phaser3
  2. Front-end deployed to S3 bucket
  3. Solidity contract deployed on Aurora mainnet. Contract address: 0xdABc474d726FBaBB8fE5FAb4D10D9fF1601fc7e4
  4. BOS components

Our codebase:

Smart contracts documentation

  • createRoom(address[] players) -> int, creates a room and returns the room ID.

  • makeMove(int roomId, int row, int col) -> int, validates and makes a move if it is valid, returns the remaining number of action points for the player (when the player changes, it returns the number of action points for the new player, not 0).

  • getBoardArray(int roomId) -> int[], returns an array representing the current state of the game board, where 0 represents an empty cell, 1 represents the first (blue) player (top-left corner, first element of the array), 2 represents the red player (last element of the array), and 3 represents a tree.

  • getCurrentPlayerIndex(int roomId) -> int, returns the index of the current player in the players array provided during room creation.

  • getCurrentPlayerMovesLeft(int roomId) -> int, returns the number of moves (action points) remaining for the current player.

  • isGameFinished(int roomId) -> checks if the game has ended.

  • getGameWinner(int roomId) -> returns the address of the winner if the game has ended (if not, it reverts, so it's better to check first).

  • getRoomIdByAddress(address player) -> (uint256) obtains the ID of the room in which a user is located based on their address.

  • getMyIndex(int roomId) -> int, returns player index (first player or second) of a method caller for the specific room.

Gamedesign

Video review

https://youtu.be/LvDQJwyCqK4

Game Design Document

GDD(future ideas included)

Current game rules:

Rules

Hustle, to roll it to the castle!

castledice-frontend's People

Contributors

holidayman avatar kastet99 avatar

Forkers

21w42

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.