DEV Community

Jonathan Reeves
Jonathan Reeves

Posted on

Run Goblin Run

You can view the original post on my personal blog site

TypeScript Can Do That?

TypeScript is a great language for building games as well as entprise level applications and web sites. If you're just starting out with TypeScript I believe that working with Phaser.js is a really great way to understand how the concepts of the language fit together.

I first started developing games using C# and the Unity game engine after tyring to learn C++ using the Unreal Engine. That was an interesting experience, given that it was my first time actually learning a programming language as well as trying to learn game development. After struggling to grasp the concepts of C++ I decided it best to find another language to learn the basics of programming and build some projects to reinforce the learning.

The Language of Choice

I decided that I would learn web development as my first foray into programming. I had some experience with Python as I was in IT and Python helped to auotmate a lot of networking tasks. Seeing that JavaScript was also a scripting languagel like Python. I learned full-stack development through Ruby on Rails and jQuery. But quickly became infatuated with JavaScript and NodeJS. I came across TypeScript a few years later and was impressed by how much of it was familiar due to my time with C# and Unity.

Why Not Unity?

I decided to give Phaser a shot instead of something like Unity or Unreal Engine 4 because I use TypeScript daily at work and wanted to see if what I knew about game development with C# could transfer over to TypeScript and Phaser. I also wanted to create a game that was easily accessible to a broad range of players. HTML5 web games seemed to be a great idea since you can open a browser on your desktop, laptop, tablet or phone and play my game right there. Unity is great but it's not that great because I would have to figure out how to port the game over to mobile and put it up on a store like Steam or Epic Games Store in order to get people to play it.

What Did I Learn?

I learned a lot through building this game. Phaser is a more in depth game engine than I think a lot of people give it credit for. It has built in physics, the ability to use any 2D asset that you have created or bought and downloaded. The engine is very easy to use and setting up all of your assets is fairly straight forward. When it comes to game development OOP reigns supreme. I am not saying that you can't build games without OOP, but OOP makes it much simpler which is something that I was struggling with at work using TypeScript. I mean after all TypeScript is just a superset of JavaScript therefore it still uses JavaScript. And all valid JavaScript is technically valid TypeScript. This project has helped me to realize that as long as I put my mind to it I can accomplish just about anything. If I am willing to take the time to look up how to add certain features and write the proper classes to be used later as blueprints for the objects then I will be in a good spot for anything else that comes my way.

Feedback and Constructive Criticism

I am open to hearing feedback. As a matter of fact I want to hear feedback on the game. I want to add some new features and will be adding them as time permits. Some of the features I will looking to add are:

  • Extra Levels
  • More Characters
  • A Shop to use your in game credits(gold nuggets) to buy character skins and levels
  • A leaderboard so you know where others are at while playing certain levels.
  • The text before starting the game as to what the controls are

If you have suggestions on how any of the above can be implemented by all means please feel free to reach out to me. Also if you have any complaints with the game please let me know. I want to make the game as fun as possible so hearing feedback is very important.

I am aware already of a couple bugs. One is that the screen has a portion of it cut off on phones. If you are playing on a tablet and have an issue with this please let me know. There is also another bug on phones that sometimes the game gets stuck showing the image to rotate your phone to a horizontal position instead of vertical. I am hoping to fix these issues as soon as I can. Again if anyone has experience with this I would love to hear from you so I can implement the changes as quick as possible.

Finally the Game

You can find the game at The controls are pretty simple however as of right now there isn't anything that shows you what they are. The controls are
spacebar if you are on a laptop or desktop, the longer you press the higher you jump

touch the screen on mobile or tablet, same as above the longer you hold your thumb or finger down on the screen the higher he will jump

I hope that you enjoy playing the game and I look forward to hearing from people.

Discussion (0)