Socket
Socket
Sign inDemoInstall

chem

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chem - npm Package Compare versions

Comparing version 0.4.3 to 0.4.4

7

lib/sprite.js

@@ -96,2 +96,7 @@ var Vec2d = require('vec2d').Vec2d;

};
Sprite.prototype.hitTest = function(pt) {
var tl = this.getTopLeft();
var br = this.getBottomRight();
return pt.x >= tl.x && pt.y >= tl.y && pt.x < br.x && pt.y < br.y;
};
Sprite.prototype.setVisible = function(visible){

@@ -124,4 +129,4 @@ this.visible = visible;

Sprite.prototype.setLoop = function(loop){
this.loop = loop;
// this is the actual value we'll use to check if we're going to loop.
this.loop = !!loop;
this._loop = this.loop == null ? this.animation.loop : this.loop;

@@ -128,0 +133,0 @@ this.setUpInterval();

2

package.json

@@ -5,3 +5,3 @@ {

"author": "Andrew Kelley <superjoe30@gmail.com>",
"version": "0.4.3",
"version": "0.4.4",
"main": "index.js",

@@ -8,0 +8,0 @@ "license": "MIT",

@@ -524,2 +524,9 @@ # chem

`Sprite::hitTest(vec2d)`
Returns boolean of whether the point is inside the bounding box
of the sprite.
Takes into account scale and current frame.
Does not take into account rotation.
`Sprite::setVisible(visible)`

@@ -647,2 +654,7 @@

### 0.4.4
* add Sprite::hitTest(vec2d)
* fix not respecting `loop` property in chemfile
### 0.4.3

@@ -649,0 +661,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc