DEV Community

Cover image for An NFT based game
Nick Taylor
Nick Taylor Subscriber

Posted on • Updated on • Originally published at iamdeveloper.com

An NFT based game

The project

So this past week I built out my second dApp with the current cohort in the Buildspace community. This time round, the project was to create an NFT based game. The goal was to make a game where you could attack a big boss via a transaction on the blockchain that would use a game smart contract.

So like the previous dApp, this required some knowledge of Solidity to build out our smart contact, Hardhat to help us develop our dApp with ETH, and some frontend skills (React and JavaScript).

The project provides a template for the frontend part, but once again I used my web3 starter project. The benefit of building out with the web3 starter is I'm improving the starter project. 😎

Going off script

Like the first dApp I built, I made it my own. Here's some fun screenshots from the game I made.

Select your player

![Mint your player in Terrible Characters](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5apna2gthcp2uzp67vd.gif)

Mint your player

![Player being minted](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uh00c3pltuxe2gexjzk3.gif)
### Attack the big boss
![A player with a minted NFT attacking a big boss in Terrible Characters](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n1w4w5ypmaa2bazttn66.gif)

When your player is dead

![When your player is dead](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c5ask849iqilo3r53uw0.png)

If you're interested in how it's all built, I've open sourced it. I’m sure there’s some refactoring to do, but I’m really happy hour it turned out.

GitHub logo nickytonline / terrible-characters

Terrible Characters is a fun NFT based game that I built as part of a Buildspace cohort. Try it out and have some fun!

Terrible Characters

Terrible Characters is a fun NFT based game that I built as part of a Buildspace cohort. Try it out and have some fun!

Select your player

Mint your player in Terrible Characters

Mint your player

Player being minted

Attack the big boss

A player with a minted NFT attacking a big boss in Terrible Characters

When your player is dead

When your player is dead

Contributing

If you are interested in contributing to the project, first read our contributing guidelines. Take a look at our existing issues, or if you come across an issue, create an issue. For feature requests, start a discussion first.

Getting Started (Local Development)

  1. Install the dependencies

    npm install
    # or
    yarn
    Enter fullscreen mode Exit fullscreen mode
  2. Start the project

    npm run dev
    # or
    yarn dev
    Enter fullscreen mode Exit fullscreen mode

Open http://localhost:3000 with your browser to see the result.

Getting Started (Gitpod)

The project can be run in Gitpod. Navigate to https://gitpod.io/#https://github.com/nickytonline/hello-edge-and-node. If you wish to load it in Gitpod as an external contributor, you will need to fork the project first, then open…

If you want to just check out the game, head on over to nftgame.iamdeveloper.com. Note that it's only on the Rinkeby test network so no real coin will be used.

Until next time!

Top comments (6)

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ • Edited

Pretty much every single post I see about blockchain/NFTs just strengthens my belief that they are still solutions looking for problems. I'm always reminded of this...
Blockchain decision tree
It's interesting tech for sure (I actually do freelance work for a blockchain-based startup), but I've yet to see a really compelling use case other than cryptocurrency. I understand all the 'trust' oriented applications of the tech, but every one I've seen still has the fatal flaw of trusting a human somewhere along the line - rendering the whole (resource hungry, complex) thing essentially meaningless.

Also, selling digital art (or any digital artefact) as an NFT is just bizarre. You have 'ownership' of something that can be freely copied by anyone?? That makes very little, if no sense at all. Guess it all boils down to the question:

Why does an object have value?

The answer being:

Because we say and agree it does

Collapse
 
nickytonline profile image
Nick Taylor • Edited

Thanks for chiming in Jon.

Yeah, I'm still exploring the space and find the tech interesting. At the moment, the only real difference in what I'm currently doing with these projects is using an API that hits the blockchain, the rest for what I'm doing is pure web dev. You do learn about building out smart contracts with Solidity which I found interesting as well.

From what I know, NFTs seem a little silly on the surface, but it's no different than collecting other things aside from yes, it's digital. I don't really play video games, but people pay for stuff all the time in video games. I could see someone wanting to own a prized character with tonnes of experience etc.

Longer term, NFTs could be a deed to phyisical property, like a house. Not saying that's going to happen, but those are some ideas. @dabit3 is really knowledgeable in this space. I imagine if you're doing some contract work in that space, you're probably following him, but if not he's a great follow here and on Twitter.

We had him on the DEV Twitch stream a while back to talk about a lot of this. Check it out if you want.

He's also hosting a Twitter Space today that might interest you.

Like I said, I'm just enjoying exploring the space at the moment. 😎

Collapse
 
ben profile image
Ben Halpern

This is cool!

Collapse
 
itscasey profile image
Casey πŸ’Ž

Awesome stuff, Nick!

I hope you liked the NFT(I made it haha)

Here's what I built:
greek-gods-nft-game.vercel.app/

Collapse
 
nickytonline profile image
Nick Taylor

Love it! I went a round as Apollo.

Playing Casey's NFT game as Apollo battling Hekate

Collapse
 
itscasey profile image
Casey πŸ’Ž

Dope choice!!