Making a multiplayer blockchain game using Phaser, NodeJS and Ethereum - Pt. 1

Zac Holland
ITNEXT
Published in
2 min readMay 10, 2018

--

Crypto Kitties is awesome. It was the first dApp to show us just how powerful, and more importantly how fun smart contracts can be.

Another blockchain game called Etheremon was somewhat recently created. It’s basically blockchain Pokemon. The only issue with this game is the cost.

I spent about $15 worth just to catch an Etheremon and battle it once.

That completely took all the fun out of it.

It got me thinking though… there must be a way to make a fun game that’s built on Ethereum, but is still cheap and accessible.

The Game Concept

The game will be a battle royale. Players enter the game with a character and a load out of items (each being their own ERC721 tokens) and fight to the death.

To make it even, the gameplay will be VERY skill based. The game will be a 2D physics based side scroller. Items will give players new skill sets and only slightly increase their stats. Maybe a pair of boots will decrease gravity or a certain shotgun can fling you around.

Coming into the game with a great item set will help you out, but you need to be able to control your player well enough to win battles.

Players can find chests in the world which will be tokens. These chests can be opened outside of the game and will randomly generate an item or two for the player.

The idea is that once players have a load out, they can play the game as much as they want for free. The only time they need to spend money on transactions is opening chests and switching items into their load out.

The Stack

The client will be made with Phaser. This will project the information from the server to the user.

The server will be made with NodeJS. Users will join the game with an Ethereum wallet acting as their account credentials. Using Web3, the server will get all the information for this player like their inventory and current load out.

The smart contract will be made with Solidity. This will handle all of the characters and items as ERC721 tokens. It’ll also handle the chests and item generation.

Up Next, Also Help Me Out!

I’m almost done getting the server and client up and running and fully connected to the Ethereum blockchain. In Part 2 I’ll describe how I did this and what the next steps are.

I’m sure there are some issues with the gameplay that I’m not thinking about. I would love all the help I can get!

The plan is to get a bare bones version of the game up and running as soon as possible so we can all try it out.

--

--

Writer for

Software engineer, love helping others and learning as much as possible