This commit is contained in:
Eric Rowell 2013-09-25 07:58:35 -07:00
parent c0313e360e
commit 6e8a5b74b9
2 changed files with 13 additions and 5 deletions

View File

@ -101,7 +101,7 @@
context.beginPath();
context.rect(0, 0, f.width, f.height);
context.closePath();
context.fill(this);
context.fillShape(this);
},
/**
* start sprite animation

View File

@ -91,11 +91,20 @@ suite('Sprite', function() {
});
layer.add(sprite);
stage.add(layer);
assert.equal(sprite.getClassName(), 'Sprite');
assert.equal(sprite.getIndex(), 0);
showHit(layer);
var trace = layer.hitCanvas.getContext().getTrace();
assert.equal(trace.indexOf(sprite.colorKey) >= 0, true);
sprite.start();
stage.add(layer);
// kick once
setTimeout(function() {
sprite.setAnimation('kicking');
@ -108,8 +117,7 @@ suite('Sprite', function() {
sprite.stop();
}, 3000);
assert.equal(sprite.getClassName(), 'Sprite');
assert.equal(sprite.getIndex(), 0);
done();
};