v3.5
3.5.26
Fixed #237 and the Turtle class not being able to make a Sprite
3.5.23
"p5.play" is now called "p5play"!
3.5.20
Fixed a bug that prevented users being unable to set sprite.ani
to a SpriteAnimation object. For example:
sprite.ani = loadAni('splat00.png', 7);
The best way is still to use sprite.addAni
though:
sprite.addAni('splat00.png', 7);
3.5.12
Added an experimental function sprite.addCollider
which adds a collider (fixture) to the sprite's physics body.
It accepts parameters in a similar format to the Sprite constructor except the first two parameters are x and y offsets, the distance the new collider should be from the sprite's (x, y) position.
One limitation of the current implementation is that the collider type can't be changed without losing every collider added to the sprite besides the first. This will be fixed in a future release.
3.5.11
I improved the contro
interface for getting input from game controllers, adding support for the GuliKit KingKong 2 Pro Controller. I also fixed a vertex mode polygon positioning bug.
3.5.10
Setting sprite.img
or sprite.image
still changes the image into a single frame animation that the sprite uses. But getting sprite.img
or sprite.image
now returns whatever the sprite is displaying, equivalent to sprite.ani.frameImage
.
3.5.9
I noticed some of my students changing the collider of sprites to static and then trying to assign the sprite a new position or size, which isn't how static colliders are intended to be used. 🙈 This caused really crazy errors when other physics bodies interact with a static collider that's had its size changed. But... instead of throwing an error if users try to do this, I just fixed the problem by forcing planck to update a static colliders size when it gets changed! So now the following code is totally fine. 😎
sprite = new Sprite();
sprite.collider = 'static';
sprite.w = 100;
3.5.8
Improved user error reports for collide and overlap functions
3.5.7
Fixed an bug with setting a circle sprite's collider type after its creation which would cause the sprite to be a box
3.5.6
Added sprite.stroke
and sprite.strokeWeight
3.5.4
Simplified and added more documentation for getting the state of an input from an input device. https://p5play.org/learn/input_devices.html
Also the inputDevice.pressing
function now returns the amount of frames the user has been pressing the input. Any non-zero number is considered truthy in JS so the function can still be used in if
statements just like before. This change brings the function inline with user expectations from the other "-ing" functions like sprite.colliding
and sprite.overlapping
.
Fixed a bug that prevented sprite.text = 0
from displaying the text "0" on the sprite.
3.5.0
Improved documentation