game development

Godot: The Open Source Game Engine

11th April 2021 - 7 minutes read time

I have been watching a lot of game development coding tutorials over the last couple of years. This includes things like the excellent Game Developers Conference (GDC), Sebastian Lague and his wonderful coding adventures series, and Yahtzee's dev diary series to name a few.

It's difficult to not see developers use Unity when demonstrating their game developing online. Some developers will directly reference it, whilst others will simply look at the code they are writing. Unity, though, didn't appeal to me as it comes with some licensing costs. You only need to pay those licensing costs if you release a game, but as a hobby developer who advocates free and open source development Unity just didn't sit well with me.

Creating A Game With PHP Part 4: Side Scrolling Shooter

10th March 2021 - 12 minutes read time

As another step up from the game of snake I created in my last post I decided to try my hand at creating a side scrolling shooter. Just like my other posts, this is an ASCII based game played on the command line.

A side scrolling shooter, if you didn't already know, moves a scene from right to left across the screen with enemies moving with the scene towards the player's ship, which is on the left hand side of the scene. The player can fire bullets towards the enemies so remove them from the scene.

In order to create a side scrolling shooter we need to define a few elements.

Creating A Game With PHP Part 3: Snake

10th November 2020 - 12 minutes read time

So far in this series of posts we have looked at detecting key presses from the user and creating a game of tic tac toe using PHP and the command line. The next step is to create a game that has graphics and real time user input. As we are using the command line we don't have much space to work with so the graphics we create aren't going to be very detailed. The simplest action game I could think of is snake. It has a few simple rules, can have very basic graphics and doesn't involve any physics or other mechanics that would effect the game as a whole. In fact the game snake dates back to the 1976 game Blockade, which was created using just text strings.

Creating A Game With PHP Part 2: Tic Tac Toe

9th November 2020 - 12 minutes read time

Following on from my last post about creating a command line game in PHP we now have a mechanism to listen to keypresses. The next step from here is to create a simple game. After thinking about a game that would fit into the command line I decided that something simple like tic tac toe (also called noughts and crosses) would be a good starting point. The game board is small and the conditions for winning are pretty simple to understand.

Creating A Game With PHP Part 1: Detecting Key Input

8th November 2020 - 6 minutes read time

I was watching a documentary about old computers on YouTube recently and it showed a video of an early computer game creating using the command line. This wasn't a text based adventure game, but a game creating using text for the graphics running as a program on the command line. This got me thinking that creating something like this should be possible using PHP. If it was possible on a 30 year old computer then surely it's possible to get PHP to do it, right? I thought it might be interesting to create a series of posts showing how to put this together.