Skip to content

Instantly share code, notes, and snippets.

@photonstorm
Created February 15, 2016 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save photonstorm/50d6a94aba9704441c7a to your computer and use it in GitHub Desktop.
Save photonstorm/50d6a94aba9704441c7a to your computer and use it in GitHub Desktop.
<pre class="ipsCode prettyprint">betterUpdateBounds: function() {        this.width = this.sprite.width;        this.height = this.sprite.height;        this.halfWidth = Math.floor(this.width / 2);        this.halfHeight = Math.floor(this.height / 2);        this.center.setTo(this.x + this.halfWidth, this.y + this.halfHeight);        //this.offset.x = (this.sprite.anchor.x * this.width);        //this.offset.y = (this.sprite.anchor.y * this.height);}</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment