Let’s Make An Ethereum Simulation Game Part 2

Playing Matches

Alex Roan
Coinmonks
Published in
4 min readMar 30, 2020

--

Photo by Moises Alex on Unsplash

Recap

In part one I outlined the idea for a Tennis Manager simulation game on the Ethereum Blockchain. I created the ERC721 Token and the TrainableTennisPlayer contract which enables owners to increase their player stats by training or resting.

Since that article, I’ve written some unit tests and made a few small changes to those contracts. Events have been added to TrainableTennisPlayer to emit when players are trained or rested. Some utility functions that were initially written in TrainableTennisPlayer have been moved the TennisPlayerBase.

At this stage, the game can create new players, and the owner of the player can level up attributes and condition by training and resting.

Figure 1 shows the TennisPlayerBase contract and Figure 2 shows the TrainableTennisPlayer contract.

--

--

Alex Roan
Coinmonks

CoFounder at Cyfrin. Previously: Chainlink Labs.