Building a Javascript game Day 3

Day 3, has been for general refactor. Adding a game model which drives all in-game interactions/actions and on-demand enabling of post-effects (explosion).

I am quite happy with the result, but still a couple days away from being able to play the game. I have squandered almost an hour figuring out a problem where the explosion post effect flipped the rendered image vertically. I spent a lot of time looking on the shaders projection matrices, just to realise the problem was in the shader itself, sampling bottom-up #facepalm.

The actions subsystem has shown to be not as robust as I expected. E.g. the use case for actions pre-creating, and reusing them over time was not thought ahead of time. Also the use case where a Node is removed from a container w/o disposing it was missing.

I still need to check on a couple shaders blending mode. I think I could improve them.

What went right:

  • Adding a model substantially improves code readability and usability.
  • Shaders model is pretty robust. It can seamlessly interact with the existing WebGL rendering context.
  • Easy hook of bubble interactions. Explosion (triggered with more than 8 popped bubbles).
  • Bubble souls, have been easily added. One every 4 popped bubbles. Its color matches the bubble selection, and its intensity, the amount of bubbles.

Day 4 plans: work towards actually playing a game.

Published by ibon

Chocolate engineer, software eater. Cool stuff at Past: Workday, Platochat, SdkBox, Chukong, Ludei.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: