Skip to content

Commit

Permalink
1.1.588
Browse files Browse the repository at this point in the history
  • Loading branch information
quinton-ashley committed Jul 5, 2023
1 parent c30efdd commit 7241bf8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
testing/experiments
testing/assets
testing/test*
package-lock.json
dev
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@
"make": "electron-forge make",
"publish": "electron-forge publish"
},
"version": "1.1.587"
"version": "1.1.588"
}
8 changes: 4 additions & 4 deletions tests/SpriteAnimation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@ test('SpriteAnimation : properties', () => {
ani0.frame = 1;
expect(ani0.frame).toBe(1);

const images1 = [p.createImage(32, 32), p.createImage(32, 32), p.createImage(32, 32)];
const images1 = [p.createImage(32, 32)];
const ani1 = new p.SpriteAnimation('custom', ...images1);

expect(ani1).toBeInstanceOf(p.SpriteAnimation);
expect(ani1.name).toBe('custom');

// test that sprite s0 is the parent of ani2
const s0 = new p.Sprite();
const images2 = [p.createImage(32, 32), p.createImage(32, 32), p.createImage(32, 32)];
const images2 = [p.createImage(32, 32), p.createImage(32, 32)];
const ani2 = new p.SpriteAnimation(s0, ...images2);

expect(s0.ani).toBe(ani2);
expect(s0.ani.length).toBe(ani2.length);

// test that group g0 is the parent of ani3
const g0 = new p.Group();
const images3 = [p.createImage(32, 32), p.createImage(32, 32), p.createImage(32, 32)];
const ani3 = new p.SpriteAnimation(g0, ...images3);

expect(g0.ani).toBe(ani3);
expect(g0.ani.length).toBe(ani3.length);
};
};
new p5(sketch);
Expand Down
3 changes: 2 additions & 1 deletion v3/p5play.js
Original file line number Diff line number Diff line change
Expand Up @@ -3659,7 +3659,8 @@ p5.prototype.registerMethod('init', function p5PlayInit() {

if (args.length == 0 || typeof args[0] == 'number') return;

owner.addAni(this);
owner.animations[this.name] = this;
owner._ani = this;

// list mode images can be added as a list of arguments or an array
if (Array.isArray(args[0]) && typeof args[0][0] == 'string') {
Expand Down
2 changes: 1 addition & 1 deletion v3/p5play.min.js

Large diffs are not rendered by default.

0 comments on commit 7241bf8

Please sign in to comment.