GithubHelp home page GithubHelp logo

anhfactor / danger-is-near Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 17.0 19.02 MB

Danger is near (play to earn game, gamefi on near chain testnet) - user play as a fireknight in a PIXELVERSE world who go to forest and kill monster. User can earn $DANGER token and score to compete with others user.

Home Page: http://danger-is-near.vercel.app/

License: Apache License 2.0

JavaScript 65.94% TypeScript 31.48% CSS 2.58%
chakra dacade gamefi near nextjs nft phaser token pixelve openblimp

danger-is-near's Introduction

Danger is near

Buy Me A Coffee

๐Ÿ“„ Overview

Danger is near (play to earn game, gamefi) - user play as a fireknight who go to forest and kill monster. User can earn $DANGER token and score to compete with others user.

  • The contract code lives in the /assembly folder.
  • The game made by phaser framework

Both contract and client-side code will auto-reload as you change source files. The contract get/save user score & using OpenBlimp library to implementation of the NEAR Fungible Token Standard, consisting of:

The demo from challenge Dacade courses "NEAR Development 101": [https://dacade.org/communities/near/courses/near-101/]

And from "learnear.club" in order to get "NEAR Certified Developer" [https://learnnear.club/?mref=anhnt4288.near%40learnnear.club]

Technology stack

  • Next.js
  • Near SDK
  • OpenBlimp
  • ChakraUI
  • Phaser

Screenshots

  • Home Page Home Page Home Page
  • Game play Game Play
  • User Vault User Vault
  • Wallet Token Wallet Token
  • Leaderboard Leaderboard
  • GameplayOverview Gameplay Overview

Installing

To run this project locally:

  1. Prerequisites: Make sure you have Node.js โ‰ฅ 12 installed (https://nodejs.org), then use it to install [yarn]: npm install --global yarn (or just npm i -g yarn)
  2. Run the local development server: yarn && yarn dev (see package.json for a full list of scripts you can run with yarn)

Now you'll have a local development environment backed by the NEAR TestNet! Running yarn start will tell you the URL you can visit in your browser to see the app.

Build and deploy your contract

  1. Build the smart contract: yarn build:contract
  2. Deploy the smart contract near deploy --acountId=<testnet account near> --wasmFile=out/main.wasm
  3. (Optional) In the assembly/index.ts file, you can modify the function ft_initialize` to replace the stub parameters with your own parameters.
  4. Use near-cli to initialize your fungible token near call <Your Contract Account> ft_initialize --account-id <Your Near Test Account Id> (In the scripts folder you can find some files with a lot of useful commands.)
  5. Mint some token in your address: near call $CONTRACT ft_mint '{"account":$ID_ACCOUNT,"amount":"100"}' --account-id $ID_ACCOUNT
  6. Launch your Near wallet and begin interacting with your new token.
  7. Set contract name in code Modify the line in src/config.js that sets the account name of the contract. Set it to the account id you used above. const CONTRACT_NAME = process.env.CONTRACT_NAME || 'your-contract-here!'
  8. Testing contract: yarn test

โš’๏ธ Game Built With Phaser 3

๐Ÿ•น๏ธ Phaser 3

๐Ÿ“ Game Instructions

For the fire knight to be able to survive you need to dodge obstacles and kills monsters.

To Jump over obstacles you can use these following keys

    โŒจ๏ธ 'W' or 'SPACEBAR'

To Attack monsters you can use these following keys

    โŒจ๏ธ 'A' or  ๐Ÿ–ฑ๏ธ 'LEFT MOUSE BUTTON'

To Drop faster (like Subway Surfer) you can use these following keys

    โŒจ๏ธ 'S' or  ๐Ÿ–ฑ๏ธ 'RIGHT MOUSE BUTTON'

๐Ÿ“œ Game Assets

Background Art

Forest Lite Pixel Art Tileset

Background

Character Art

Elemental Fire Knight

Elemental Fire Knight

Attack

player_jump

Death

Enemy Art

Bringer Of Death

Idle

Walk

Attack

Death

Sound Effects

Super Dialogue Audio Pack (death) by Dillon Becker. This work is licensed under CC BY 4.0

5exuIn


Game Over SFX obtained from Zapsplat

Music

Intro: VGMA Challenge (July 12th Challenge) by Abstraction

Game: A Mystical Journey by FATAL EXIT. Licensed under CC BY 4.0.

Ending: III. Finale: Slowly by Dee Yan-Key. This work is licensed under CC BY-NC-SA 4.0

Font

Arcadia by Alex Wan. This work is licensed under CC BY 4.0

LKtY+p

danger-is-near's People

Contributors

anhfactor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.