@code-dot-org/dance-party
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "@code-dot-org/dance-party", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -29,3 +29,3 @@ "main": "dist/main.js", | ||
"@babel/preset-env": "^7.7.6", | ||
"@code-dot-org/p5.play": "^1.3.12-cdo", | ||
"@code-dot-org/p5.play": "^1.3.14-cdo", | ||
"babel-loader": "^8.0.6", | ||
@@ -32,0 +32,0 @@ "babelify": "^6.3.0", |
@@ -1,3 +0,3 @@ | ||
[![travis-ci](https://travis-ci.org/code-dot-org/dance-party.svg?branch=master)](https://travis-ci.org/code-dot-org/dance-party/builds) | ||
[![codecov](https://codecov.io/gh/code-dot-org/dance-party/branch/master/graph/badge.svg)](https://codecov.io/gh/code-dot-org/dance-party) | ||
[![travis-ci](https://travis-ci.org/code-dot-org/dance-party.svg?branch=main)](https://travis-ci.org/code-dot-org/dance-party/builds) | ||
[![codecov](https://codecov.io/gh/code-dot-org/dance-party/branch/main/graph/badge.svg)](https://codecov.io/gh/code-dot-org/dance-party) | ||
@@ -4,0 +4,0 @@ Steps to get up and running |
@@ -18,3 +18,3 @@ const DEBUG = false; | ||
const spritesToLog = p5.allSprites.slice(0, SPRITE_LIMIT); | ||
const spritesToLog = p5.allSprites.filter(sprite => sprite.isDancer).slice(0, SPRITE_LIMIT); | ||
frame.sprites = spritesToLog.map((sprite) => ({ | ||
@@ -21,0 +21,0 @@ animationFrame: sprite.animation && sprite.animation.getFrame(), |
@@ -9,11 +9,17 @@ const test = require('tape'); | ||
createSprite() { | ||
createDanceSprite() { | ||
this.allSprites.push({ | ||
getAnimationLabel: () => {}, | ||
mirrorX: () => {}, | ||
isDancer: true | ||
}); | ||
} | ||
// Some effects (ex. quads) create sprites which are not dancers | ||
createEffectsSprite() { | ||
this.allSprites.push({}); | ||
} | ||
} | ||
test('replay', t => { | ||
test('Dance sprites are added to replay log', t => { | ||
const p5Inst = new mockP5(); | ||
@@ -25,3 +31,3 @@ | ||
p5Inst.createSprite(); | ||
p5Inst.createDanceSprite(); | ||
replayLog.logFrame({p5: p5Inst}); | ||
@@ -31,3 +37,25 @@ t.equal(replayLog.getLog().length, 2); | ||
p5Inst.createDanceSprite(); | ||
replayLog.logFrame({p5: p5Inst}); | ||
t.equal(replayLog.getLog().length, 3); | ||
t.equal(replayLog.getLog()[2].sprites.length, 2); | ||
replayLog.reset(); | ||
t.end(); | ||
}); | ||
test('Effects sprites are not added to replay log', t => { | ||
const p5Inst = new mockP5(); | ||
replayLog.logFrame({p5: p5Inst}); | ||
t.equal(replayLog.getLog().length, 1); | ||
t.equal(replayLog.getLog()[0].sprites.length, 0); | ||
p5Inst.createEffectsSprite(); | ||
replayLog.logFrame({p5: p5Inst}); | ||
t.equal(replayLog.getLog().length, 2); | ||
t.equal(replayLog.getLog()[1].sprites.length, 0); | ||
replayLog.reset(); | ||
t.end(); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24341575
113236