Javascript lesson 5ive. Arcanoid game. Event handling.

Hi folks,

before we start making things move, one more boring thing that helps us in development.
The issue is, we don’t know when exactly game events happen. But we need to respond somehow on these events. For instance, we never know when the user moves the mouse but we need to move the racket accordingly.
The event handling mechanism comes to rescue.
Continue reading

Javascript lesson four. Arcanoid game. Game model.

Hi folks,

hope you managed to break your code apart. Today I bought another boring lecture about the game model. Why boring — there will be a lot of abstract thins and nothing changes significantly on the screen. On the other hand, we need to understand how the data flow in big application is organized and how is it made that programmers can handle hundreds of files and not get mad.

Spoiler: there will be another boring abstract session next time.
The lesson after the next one ties all these abstract thing together and allows you eventually to play your own game.

Continue reading

Javascript lesson three. Arcanoid game. Organize your code.

Ok Google, where is my whiskey continuing with the Arcanoid game and Javascript lessons.

Before we start,

I believe you already know:

  • variable scope in Javascript;
  • objects;
  • JS Functions; anonymous functions; self-executing functions (read here).

Why modules?

Applications in real life are big enough. That means thousands lines of code. If all they were in one file, it would be really hard to handle it.
The obvious solution is divide the code in several files. There are some pitfalls here:
Continue reading