HTML5 Game Development Blog

  • Tiled Game Engine slide

Supporting animated units

Category : Tiled Game Engine Mar 13th, 2015
Supporting animated units

Any game, especially RPG (or strategies, tower defenses and other types of games) use units player dial with – player…

Garbage collection in the game loop – Chrome failure

Category : Experiments, JavaScript Mar 11th, 2015
Garbage collection in the game loop – Chrome failure

Garbage collection for the game engine is a real pain. We can’t presume when it start working and how long will…

Supporting animated tiles in TGE

Category : Tiled Game Engine Mar 10th, 2015
Supporting animated tiles in TGE

Animated tiles is very cool feature, that can be easily utilized to bring some live in your Tiled maps. It…

HTML5 Optimization tips: throttle input and requestAnimationFrame

Category : Tiled Game Engine Mar 3rd, 2015

Well, some short post about user interaction and animation performance. In any game we need some actions from user and, in the same time, we have to run our animation loop with constant frame rate. In that post I’ll cover some techniques how to do  that with minimum impact on frame rate with respect to browser internals: throttle and requestAnimationFrame in hands.

Game render optimization: cache, check and invalidate

Category : Tiled Game Engine Feb 27th, 2015

Previously we’ve managed to render TMX map on multi-layered canvas. Now, it’s time to optimize our code, to get 60 FPS on any map size. First of all let’s start with game render optimization. First thing you should take in mind, that you do not need to redraw scene on each frame. Canvas is a persistent object, that means that it doesn’t clear itself. So, we need to track if our scene has been changed and redraw it, if any. You’ve probably already noticed some conditions in the TiledGameEngine code, that was not explained early. Now it’s time to cover it.