Tag Archives: JavaScript

The Basics of A* Pathfinding – part 1

The A* algorithm allows you to find the shortest path between two points with (impassable) obstacles between them. The key word here is “shortest”. Let’s take a look at what that means: How A* “sees” it Imagine we have the … Continue reading

Posted in Examples, Game Dev | Tagged , , , , , , , , , , , | 12 Comments

Using a Queue for User Input Events

This post will discuss how to handle user input in a game. More specifically, we’ll be looking at how to use a queue data structure for the input events, check out an example implementation (in JavaScript) and contrast it with … Continue reading

Posted in Examples, Game Dev | Tagged , , , , , , | Leave a comment

The Basics of Game Loop Implementation – part 3

Intro A good way to code a game loop in JavaScript is to use the new “Timing control for script-based animations” aka “requestAnimationFrame” feature. The specs for this are still in draft state, but most modern browsers support it one … Continue reading

Posted in Examples, Game Dev | Tagged , , , , , , , , | 2 Comments