Spelchan.com Logo

From Scratch Web Games: A Beginners Guide to Game Development using HTML, CSS, and JavaScript

Chapter 1.1: Why this book?

I originally set out to write a book on creating a game engine in JavaScript which I would use for porting my older Flash and Java games to a more modern format. This is still my plans, but my ambitions and goals have changed a little bit. As I have learned from my work as a college professor, many subjects require a set base of knowledge from the students. The courses that I taught were all later year courses, so it was assumed that the students going into the courses I was teaching would have a set level of skills acquired from earlier courses. This is the reason that the dreaded prerequisites exist for courses. There is little enough time in the term to properly cover the topics of the courses I am teaching let alone cover topics that the students should already be familiar with. While this works to a large extent, you still do encounter students who didn’t fully grok the necessary material. If there was a really bad professor teaching that course, or the student took the course at a different institution, you can end up with a situation where the students are not properly prepared for the course.

Writing a game engine is a very complicated task so would require a lot of prerequisite knowledge. Originally, this was going to be handled by assuming that readers would be able to fill in their knowledge gaps by taking advantage of the large number of existing books and videos on the topic. My plan was to write some cheat sheets for the different topics that would be needed and use that as the starting point. While I was creating the cheat cheats in the very sparse spare time I had, there was an incident at the college I was teaching at. I encountered some students who were not properly prepared for one of the courses I was teaching and while I was able to help them get past their lack of knowledge, it emphasized the fact that relying on other sources for the training of the basics may not be the best approach. So instead of writing a game engine book for intermediate programmers, I would first write a book that teaches the novice programmers the concepts necessary for the game engine book and then write the game engine book.

The first draft of this book will be made available for free, though I may also have more refined paid versions available once the book is complete. The draft version will be released in a serial form with a new section being released every Sunday, with the occasional break for other things.

As the ultimate purpose of this book is to make sure that everyone is on the same page when it comes to my game engine, each chapter will start with a cheat sheet that summarizes the material covered in the rest of the chapter. If you believe that you understand what is in the cheat sheet, skip to the end of that chapter and take a crack at the chapter project, otherwise work your way through the chapter.

The end of each chapter will be a project that can be completed by anybody who understands the material. This will be presented in two sections. The first section is the description of the project. The second section is a description of how I did the project. I recommend not looking at the second section until after you have at lease attempted the project. The source code is not included as part of the book, but will be made available as a git repository.

Sidebar: why HTML+CSS+JavaScript?

Most sections of the book will have a sidebar. This provides additional material about the topic at hand though may also be just a rant.

For the introduction, I will be simply explaining why anyone would work with HTML, CSS, and JavaScript which are the technologies being used in this book. The simple answer is that is what the World Wide Web (WWW) uses for it’s pages. Web pages are in HTML (Hyper-Text Markup Language), which is a mark-up language used to describe the contents of the page. The layout and style of a page are controlled using CSS (Cascading Style Sheets), while any interactions are controlled with the JavaScript programming language.

JavaScript is the programming language for the web, as it is what browsers support without requiring plug-ins. Some other languages were supported through the use of plug-ins, but they were not a standard. This meant that a browser couldn’t run a program if the user didn’t install the appropriate plug-in which meant that users had to find and install the plug-in assuming it was even available for the browser they were using. This proved to be a huge hassle so when Apple introduced their iPhone, the browser on that simply did not support plug-ins. Other browser venders took the popularity of the iPhone to start removing plugins which resulted in the death of many plug-in based formats such as Flash.

This meant that anything that ran on the browser was limited to using HTML+CSS+JavaScript even though there were several attempts at adding additional languages. A rather new addition is the addition and support of Web Assembly (WASM) but that is an advanced topic, though in theory it will allow other languages to be used. We will cover WASM in future sidebars.

← previous section
Chapter 1 index
next section →
1.2 Who this is for/tools
Table of Contents