Skip to content

v3.4

Compare
Choose a tag to compare
@quinton-ashley quinton-ashley released this 18 Dec 23:32

3.4.13

Using the SpriteAnimation constructor is now equivalent to using loadAnimation. I also fixed inheritance order for animations, if say you had a default animation for the allSprites group and a default for the sprite's immediate parent group, then the sprite would inherent the default animation from it's parent group.

3.4.7

A sprite with no collider ("none") can now be set to have a "dynamic", "kinematic", or "static" collider.

3.4.4

One of my students convinced me that it was a bad decision I made in v3.3.9 (8 days ago) to detach a sprite's scale from the scale of its animations (making it only scale the sprite's collider).

The problem is that if a sprite has a lot of animations, then it's very tedious to go through and scale all of them individually. 😭 I think they're right. If you need to scale a sprite's animation individually you still can, but now it will have a multiplier effect on top of the sprite's scale. I think that makes a lot more sense intuitively. 🧠

Here is the finalized example of using sprite.scale: https://editor.p5js.org/quinton-ashley/sketches/rQZNY7-n6

3.4.2

Fixed changing the collider type of circle sprite, a regression in 3.4.0 made it turn in to a box. If moveTo or moveTowards is used with the mouse object, the sprite or group will not move until the player performs a mouse input or hovers on the canvas.

3.4.1

Fixed origin calculation for non-convex polygon shaped chain colliders. Such as the hourglass in this example:
https://p5play.org/demos/?file=hourglass.js

3.4.0

I made this page to demonstrate movement sequencing via the power of async/await! 🐢
https://p5play.org/learn/sprite.html?page=8

When working on that page, I noticed a problem with polygon/chain sprite rotations: their (x,y) position changed slightly while the sprite was being rotated! OOF.. 😟 TLDR: I fixed it. 🥳

Turns out planck uses the triangle centroid (vertex averaging) method of determining the center of any polygon physics body, meanwhile I was just taking the total width and height and dividing it in half to get the center. So when rotated, a polygon physics body's center would no longer match up with its center in p5.play. Fast forward a whole day of coding later: problem solved! These changes have no effect on sprites with box, circle, and non-polygon shaped chain sprites.