The Phaser inputEnabled component for use on Sprites, Graphics, ect

The phaser ce inputEnabled component is used in most game display objects including sprites to allow for input handing in relation to the display object. These are many instances of a Signal than can be used to attach event handers that will fire when a player does something such as clicking or touching the display object. This post will serve as an overview of the input enabled component in phaser ce, and I will like to other relevant posts on handing input in a phaser ce project where appropriate.

Read More

Playing with lines in phaser with Graphics.lineTo

I have made a post on graphics in general in phaser and as such I spent some time playing with Graphics.lineTo, and Graphics.moveTo when it comes to drawing lines in phaser. Because there is a great deal that can be done with lines, and graphics I thought that this needs a post of it’s own. This post will mostly be about use examples of lineTo in phaser ce.

Read More

Working with on the fly graphics in phaser

In my effort to make a great series of posts on phaser ce, it is only a matter of time until I started writing on how to make on the fly graphics in phaser. This is something that I often want to do in the early stages of a project where I just want to know the location of what will eventually be a sprite, or even a project with no external assets which can happen sometimes with something pretty simple.

So this will be a quick how to get started with graphics in phaser post, but also a review of the most important methods and properties with Graphics display objects in phaser ce.

Read More

The lodash _.throttle method.

There are times when I want to fire a method once an amount of time has passed, and also fire the method over and over again also. When it comes to native javaScript I can always just use setTimeout or setInterval, as well as request animation frame when it comes to client side javaScript. There is also using these methods to make my own kind of main event loop or state machine solution from the ground up also when it comes to working with javaScript by itself. However this is a lodash post as such I shale be writing about some _.throttle examples, which is one way to make throttled methods using lodash. However I will also be exploring alternatives to the lodash throttle method as well using the vanilla javaScript solution that I have mentioned.

Read More