Setting, and getting point length in phaser with Point.setMagnitude, and Point.getMagnitude.

So these days I have been expanding my content on Phaser ce, because phaser is just awesome, and deserves a fair share of my attention. In todays post I will be writing yet another post on the Point class, and it’s many useful methods. This time I will be writing about Point.setMagnitude, and Point.getMagnitude. Just yesterday I wrote a post on Point.normalize which is the same as using Point.setMagnitude(1). So in other words normalizing a Point is the process of making the unit length of a Point one. The methods I will be writing about in this post have to do with setting the length to something other than one.

Read More

Rotating one sprite around another in Phaser using Point.rotate

So far this week I have been expanding my content on Phaser ce with the Point Class. This is a very helpful Class that helps with common issues that developers run into when dealing with points in a 2d space. In this post I will be writing about the Point.rotate methods, that can be used to rotate a sprite around another sprite, or any object that has exposed x, and y properties for that matter. This should be fun, so lets get into it.

Read More

The fs.createReadStream method

In the post I will be writing about read streams in node.js using the fs.createReadStream. This method is one of many examples of streams in node.js, so if you are new to streams it makes sense to just start playing around with some of these methods. The fs.createReadStream is an example of a readable stream, and as such it can only be used to read data from a file, which differs from Writable and Duplex streams. This methods can be used in conjunction with a writable stream, including the fs.createWriteStream method. So lets take a look as some examples of working with readable streams with node.js, and it’s built in file system module.

Read More