Socket
Socket
Sign inDemoInstall

chem

Package Overview
Dependencies
1
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 2.0.0

12

doc/api.md

@@ -60,3 +60,2 @@ **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*

- [alpha](#alpha)
- [id](#id)
- [font](#font)

@@ -125,3 +124,2 @@ - [textAlign](#textalign)

- [alpha](#alpha)
- [id](#id)
- [animation](#animation)

@@ -499,6 +497,2 @@ - [animationName](#animationname)

#### id
Read only. Uniquely identifies this `Label` among other labels.
#### font

@@ -640,3 +634,3 @@

Read/write. Defaults to 1000;
Read/write. Defaults to 10.

@@ -883,6 +877,2 @@ #### duration

#### id
Read only. Uniquely identifies this `Sprite` among other sprites.
#### animation

@@ -889,0 +879,0 @@

7

doc/history.md
# History
## 2.0.0
* remove label.id and sprite.id
* Batch is faster
* chem.button was missing Key5 - Key9. Fixed.
* sound.maxPoolSize now defaults to 10 instead of 1000
## 1.0.2

@@ -4,0 +11,0 @@

@@ -12,5 +12,5 @@ module.exports = Batch;

if (item.visible) {
var o = this.layers[item.zOrder];
if (! o) o = this.layers[item.zOrder] = {};
o[item.id] = item;
var layer = this.layers[item.zOrder];
if (! layer) layer = this.layers[item.zOrder] = [];
layer.push(item);
}

@@ -20,4 +20,6 @@ };

Batch.prototype.remove = function(item) {
var o = this.layers[item.zOrder];
if (o) delete o[item.id];
var layer = this.layers[item.zOrder];
if (!layer) return;
var index = layer.indexOf(item);
if (index >= 0) layer.splice(index, 1);
};

@@ -28,7 +30,6 @@

var layer = this.layers[i];
for (var id in layer) {
var item = layer[id];
item.draw(context);
for (var spriteIndex = 0; spriteIndex < layer.length; spriteIndex += 1) {
layer[spriteIndex].draw(context);
}
}
};

@@ -32,2 +32,7 @@ var KEY_OFFSET = 0;

4: 52,
5: 53,
6: 54,
7: 55,
8: 56,
9: 57,
A: 65,

@@ -34,0 +39,0 @@ B: 66,

@@ -5,4 +5,2 @@ var Vec2d = require('vec2d').Vec2d;

Label.idCount = 0;
function Label(text, params) {

@@ -30,3 +28,2 @@ this.text = text;

this.id = Label.idCount++;
this.setVisible(params.visible == null ? true : params.visible);

@@ -33,0 +30,0 @@ }

@@ -11,3 +11,3 @@ var EventEmitter = require('events').EventEmitter;

this.audioPool = [new Audio(src)];
this.maxPoolSize = 1000;
this.maxPoolSize = 10;
this.volume = 1;

@@ -14,0 +14,0 @@ this.preload = "auto";

@@ -8,4 +8,2 @@ var Vec2d = require('vec2d').Vec2d;

Sprite.idCount = 0;
util.inherits(Sprite, EventEmitter);

@@ -24,3 +22,2 @@ function Sprite(animationName, params) {

this.id = Sprite.idCount++;
this.setAnimationName(animationName);

@@ -27,0 +24,0 @@ this.setLoop(params.loop);

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

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

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc