Table of Contents
This is a submission for Upgrade StackUp Invaders Bounty.
-
Reading player's NFT inventory and resume level (refer
getNftByAccountfunction here)- this helps ensure each player has only one NFT
- player will be able to start game with their upgraded spaceship and resume with their previous level based on their NFT metadata (refer
getUserLevelfunction here, how it's called insetupfunction here & which is then called indrawfunction here when userProfile changes)
-
Minting just one NFT for every new player and refreshing metadata on subsequent levels up
-
View NFT metadata page
- added new route /nft.html?id={tokenID} (refer html code here and JavaScript code here) for users to view their NFT metadata since immutable explorer doesn't support metadata refresh yet
- added links for user to easily navigate to their nft metadata page next to logout button and successful minting/upgrading message (refer
showViewBadgeButtonfunction here)
-
Increasing difficult of game by increasing the points needed to collect to uplevel
- now user need to collect at least 100 points to level up instead of 50 points (refer here)
-
Having more achievement milestones
- now user can achieve up to level 4 (refer here)
-
Enhancing security by
-
Immutable for deployment of ERC721 contract
-
Netlify function for
grant minter role&refresh metadatafunctionalities
-
Immutable Passport for authentication
-
ethers.js for utils to interact with smart contract
-
p5.js for creating game
-
Netlify for hosting frontend site
- Clone the repo
git clone https://github.com/teyweikiet/immutable-stackupinvaders-bounty- Install dependencies
npm install- Follow steps here to deploy NFT smart contract
- Copy and modify .env accordingly
cp .env.example .env-
Search for
TODO: Replacein/sitefolder to replace with appropriate values -
Start server locally
npm run start:local-
Refer
.env.examplefor environment variables needed. Add those environment variables to Site Configuration on Netlify dashboard -
Deploy to Netlify on your local terminal
npm run deploy:netlifyP/S: Disable automatic publishing on Netlify dashboard as current setup does not support deployment from github.