Danger is near
đ 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
/assemblyfolder. - 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]
- Demo Website.
You can signup here to learn and earn crypto: https://dacade.org/signup?invite=anhfellow
Technology stack
Next.jsNear SDKOpenBlimpChakraUIPhaser
Screenshots
- Home Page

- Game play

- User Vault

- Wallet Token

- Leaderboard

- GameplayOverview

Installing
To run this project locally:
- Prerequisites: Make sure you have Node.js âĨ 12 installed (https://nodejs.org), then use it to install [yarn]:
npm install --global yarn(or justnpm i -g yarn) - Run the local development server:
yarn && yarn dev(seepackage.jsonfor a full list ofscriptsyou can run withyarn)
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
- Build the smart contract:
yarn build:contract - Deploy the smart contract
near deploy --acountId=<testnet account near> --wasmFile=out/main.wasm - (Optional) In the
assembly/index.tsfile, you can modify the function ft_initialize` to replace the stub parameters with your own parameters. - 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.) - Mint some token in your address:
near call $CONTRACT ft_mint '{"account":$ID_ACCOUNT,"amount":"100"}' --account-id $ID_ACCOUNT - Launch your Near wallet and begin interacting with your new token.
- Set contract name in code
Modify the line in
src/config.jsthat 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!' - 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

Character Art




Enemy Art




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

Game Over SFX obtained from Zapsplat
Log in or sign up for Devpost to join the conversation.