Mastodon Icon RSS Icon GitHub Icon LinkedIn Icon RSS Icon

Tag Phaser.io

Quick Dev Tips: Pixel-Perfect Scaling of a Phaser game

Header image for Quick Dev Tips: Pixel-Perfect Scaling of a Phaser game

As you may know, I am in the middle of developing a demo for some Smart Pathfinding, and I’m using Phaser and TypeScript for it. Unfortunately, as soon as I started coding a couple of days ago, I quickly found a problem. How can I do pixel-perfect scaling of the game?

The tileset I’m using is very small (16x16 pixels tiles) and I needed to scale them at least 3 times to make them visible on a big screen. However, searching for “phaser.io” and “scaling” returns a lot of not useful results.

Basic Bootstrap for Phaser.io and Typescript Game Development

Header image for Basic Bootstrap for Phaser.io and Typescript Game Development

In the last period, I’m really enjoying TypeScript. It is typed, can be used in a functional way without effort, it like a C# for the Web, in short, I love it. For this reason, I started converting some old Phaser.io demo in TypeScript, for fun.

So, why I’m writing here? To solve two main problems. First, the TypeScript guide in the Phaser.io web page is really outdated. Second, there are a lot of “template” project fo Phaser.io you can download. These templates are really state-of-the-art level: they use Gulp, Grunt, NPM and another million of tools.