Notes on software development

Game Development

Graphs and Pathfinding

Pathfinding is a classic problem. It typically involves finding the shortest or cheapest path between two points. There are many algorithms to solve this problem, most of which are based on graphs with various modifications. Some algorithms are more effective than others, depending on the situation. Let's go through some of the most popular ones and discuss which algorithm is more effective in which scenario. We'll look at several commonly used algorithms: BFS, GBFS, Dijkstra, and A*.

JavaScript Canvas Sprite Animation

Sprite sheets have been used in game development for many years. In web development it allows you to reduce:

  • a number of HTTP requests for downloading many separate images,
  • webserver load as a result of fewer requests,
  • download time as a combined sprite sheet is smaller than the individual files.

I want to share the approach that I used in my games written with canvas and javascript. I think this is a reusable approach for animating different objects on a canvas.

To demonstrate it, I compiled a Sonic sprite sheet from the "Sonic the Hedgehog 3" game.