In todays post on Phaser ce I will be covering the Point.centroid method than can be used to quickly get the arithmetic average of an array of Phaser.Point instances in the form on a single Phaser.Point instance. This might come of use in certain projects where such a point is of interest.
In this post I am using phaser community edition 2.11.1 of phaser
A basic example of Point.centroid would just be something like this then.
I just created an array of two points, and then used the Phaser.Point.centroid static method to get the average of those two points.
This is an interesting method, of course it would not be to hard to make my own method to do it from the ground up, but it is nice to know that many methods like this are in the Point class that can be used to help me save time from writing a solution over each time.