12/28/14 Weekly Update

I spent last week learning about a combination of game development in HTML and Javascript. I would like to get the basics down and eventually port an example to Go.

Here’s what I ended up creating, it’s just a blue box that moves from left to right and loops. Nothing crazy but to me there’s a lot of work that went into it. I’ve created a repository to consolidate files and learning [here](). I will supplement my learning with tutorial style posts.


Brain dump of some of the things I’ve worked with.


My take on this is that I believe javascript shouldn’t never have been given such “leeway” in the first place but I can understand why given its history. I’m glad that an effort to standardize javascript is in process, and without a very good reason everyone should write js “strictly”.

####Game Programming

So, Game objects will be created and interact with each other + other sources. There is game logic that will be calculated based on the state and behavior of the game objects and their relation to other sources of input. Based on those calculations, the next visual frame is drawn. A loop repeats this.

To be more clear, we can think about how Pacman works. When the user presses the key to move up, the game engine takes note of that and draws Pacman in a position higher than he was in the previous frame. If he makes contact with a dot, the game engine takes note of it and removes the dot, updating points as necessary. When Pacman dies by making contact with a ghost, the game notices that and proceeds to show a game over message. Additionally, the game may start when you press/initiate start. In the case of an arcade machine, the game engine will not start the game unless there are credits that are generated by the player inserting tokens. As you can see, there’s a good amount of logic that goes into the game. The engine’s job is to keep track of all game logic + display the next appropriate frame.