melonjs/melonJS — pull request #408 by chrismccaw (2014-02-09 06:59:35+00:00)
Title: Helper function for a platform game to move an entity to a specific destination 

I needed to the ability for my enemy entity to move to a certain destination on the x axis based on a value from the server. I created a helper function to allow me to do this.

I two created functions on the ObjectEntity to achieve this.

setXDestination - set the destination x axis
walkToXDestination - It is useful to call this from the update function in your entity
For example:
update: function() {
this.moveToXDestination();
return true;
}

Do you see any problems with this or improvements I should make?