https://github.com/profffff/nftpetapp
Demo: https://nftpet.netlify.app/
It's a small personal project-game where the main goal is to raise a pet (aka Tamagotchi), with the reward being the opportunity to mint an NFT. The token can be used as a character in the game.
A self-made collection of NFTs, strikingly reminiscent of Pokémons.
To get a reward (NFT), you need to poke 15 times on the correct buttons and the pet's mood should be good (8) or better. Incorrect actions lead to a decrease in mood.
Stages:
0 dead
1-2 angry
3-4 sad
5-6 neutral
7-8 good
9-10 happy
P.S. The supply of NFTs available is limited to 1500, and may run out. Have fun!
Clone project locally
Create .env.local file in the root directory (check .env.example to see what needs to be included)
Install dependencies:
npm install
Run the development server:
npm run dev
Open https://localhost:3000 with your browser to see the result.
- Programming language: TypeScript
- Frontend framework: React.js
- Framework for server-rendered React applications: Next.js
- Game development framework: Phaser
- Smart-contract: Thirdweb
- Blockchain interaction framework: Wagmi
- TS interface for Eutherium: Viem
- HTTP client: Axios
components
- Contains the React components.src
- Contains the game source code and app entry points.src/app/page.tsx
- The main Next.js component.src/app/App.tsx
- Midleware component used to run Phaser in client mode.src/game/PhaserGame.tsx
- The React component that initializes the Phaser Game and serve like a bridge between React and Phaser.src/game/main.tsx
- The main game entry point. This contains the game configuration and start the game.src/values/constants/gameConstants.ts
- Game settingspublic/assets
- Contains the static assets used by the game.
Amoy Testnet for Polygon PoS
Google Lighthouse Score: 77
src.IndexOf error after minting the NFT
happy animation glitch along the Y-axis
disfunction of the scene manager due to init() in the main scene
css libraries are not used properly (just unnecessary dependencies)
Feel free to get in touch
Nik