Starting out in programming can be quite daunting for some and I was no exception.
All those years ago when I found myself beginning that journey, I was lucky in a way as I started with raw HTML using just the Notepad text editor and a book I had hired from my local library (remember those?).
It wasn’t long before I got to grips with the basic tags and had managed to make my first web page. Zip forward a bit and I found myself in college taking my first programming lecture…
As is customary, the first actual programming I did was to create the ubiquitous ‘Hello World’ example and the language used was Turbo PASCAL.
For some reason Turbo PASCAL was a blue background with yellow/white text and my lectures used to be at the end of a Monday for 2-3 hours! As I am sure you can imagine this was not an ideal scenario and often I would head home on the bus with a blinding headache.
I didn’t mind the coding so much but the combination of it being on a Monday (everybody hates Mondays right?), and the 3 hours of bright blue screen induced headaches every time did not lend itself well to me enjoying it.
This carried on until one day we switched languages to a rather forgotten language these days: Borland Delphi.
Delphi made quite an impact on me as the change from the ‘blue pain inducing text editor’ to a pleasant windows GUI based language with pleasant grey/white visuals really made me start enjoying what I was doing.
The great thing about Delphi was also the fact that it was ‘proper’ Windows software developing tools and we were lucky enough to get told by a lecturer that the next issue of a PC magazine was giving it away on the next issue (the best £5 I have ever spent on a magazine to this day I think).
The magazine came with a CD-ROM in a proper jewel case and it included Delphi 2 which allowed for making 32-Bit software applications, but also as a bonus, it included the previous version Delphi 1 which allowed for making 16-Bit applications as well.
We spent less time in Delphi 2 than we did in Turbo PASCAL but I enjoyed my time in Delphi 2 very much.
It was unfortunate that I didn’t keep going with programming after it started to get overwhelming due to other lectures being beyond my abilities and eventually I left college and put programming out of my mind due to not having the Math ability to see myself getting somewhere with it.
The crazy thing was that I had grown up in the ‘golden age’ of video games and most of my youth had been spent, eyes-glued, to a TV screen playing Spectrum and Amiga games but for some reason I didn’t quite ‘get’ the link between my enjoyment for video games as a child and the fact that programming could be pursued through making video games!
After many years away from programming I eventually got more and more interested in taking the plunge back into programming and had decided that video games were going to be the mechanism for me to attempt this.
I spent some time online doing some reading/research/learning and it wasn’t long before I realised I was in over my head again! Then I found this…
I watched this video and couldn’t believe how quickly you could have a playable game running and it was only around 130 lines of code.
Feeling like this was a good entry point back into programming (and more importantly a start into video game development), I watched the video a 2nd time and noticed it was using HTML5 and the ‘canvas’ element.
I did a quick search for HTML5 games and found that there was a huge wealth of these games made online and ranging from beginner type games right through to full releases on mobile and the likes of Steam for PC.
I had found my motivation and the enthusiasm to give programming another try!
I spent about 2 hours typing out Mary’s code from her live presentation and at the end of it I tried to run it…
It didn’t work.
So I then went back to the video and re-watched it, pausing every few seconds to double check my code against Mary’s live coding.
What is important to note here is that at the very beginning Mary does state that she is likely to make some mistakes and true to her word there were some issues that if you followed her live exactly, you wouldn’t have a working program.
Unperturbed, I remembered my troubleshooting days of HTML and set about sectioning off my code to see where the point was that things started to go wrong.
This proved half-helpful but in the end I actually stopped as I still couldn’t understand where the issue was.
The next day I decided to just start from the beginning again but this time, every 5 minutes of her video I stopped and ran the code until it eventually didn’t work.
This was useful as the only reason it didn’t work was not due to a mistake by me, but unfortunately Mary during the live code and missed out covering a few things.
I did work this out and solve it myself after some thought but for anyone right now reading this and trying the video, the way to help solve it with zero coding experience is to head on over to Mary’s GitHub which she mentions in the video and have a look at her polished code of the space invaders example.
By doing this you can realise that something vital is missing and not mentioned during the live video and then you can add it to yours and the game will run.
Once I had this solved and the game ran like Mary’s in the live video, I carried on following and paused every 5 minutes to check it still ran and worked the same way as Mary’s.
This approach worked well and at the end of the video, not only did I have my first working game, but I also had the understanding of how to add other features to the game and potentially build upon this.
For anyone interested in learning – Do not, under any circumstance, just copy-paste the code!
This would be pointless as you won’t learn anything at all.
(Okay, maybe not completely pointless if all you want to do is play Space Invaders!)
So yeah, for me it definitely was a case of ‘Hello Canvas‘
Huge thanks to Mary Rose Cook for the video, I was on the fence and your video was the catalyst for my game dev finally!
I am forever grateful ;o)