Skip to content

v3.20

Compare
Choose a tag to compare
@quinton-ashley quinton-ashley released this 14 Mar 03:16
· 37 commits to main since this release

3.20.11

contros.swap should also update contro in p5.js if contros[0] is changed.

3.20.10

More sophisticated feature detection for Contro object's hasAnalogTriggers property

3.20.9

The way I had implemented contro did not work properly with p5. Fixed it real quick!

3.20.8

Added world.meterSize.

Fixed camera support with p5's webgl mode.

3.20.7

Upgraded the controllers array, now aliased to contros (with an "s") instead of contro.

contro will still attempt to get input from the first controller but if it doesn't exist, it'll get a mock controller. The mock controller object can be used for testing or even TAS purposes.

I also publicly exposed Contro as a public class in case users want to make additional mock controllers. Added getter hasAnalogTriggers to controller objects.

Added contros.onConnect, contros.onDisconnect, contros.swap, and contros.remove functions.

Fixed some mistakes that had broken the camera for canvas 2d mode.

I still need to implement proper support for the camera in p5's webgl mode.

3.20.5

p5 webgl mode support is ready for beta testing!

new Canvas(400, 400, 'webgl');

p5play canvas presets can still be used but must be specified before the mode param:

new Canvas(400, 400, 'fullscreen', 'webgl');

Also fixed a q5.js bug with sprite.strokeWeight = 0, which should just make chain colliders not be drawn.

3.20.4

Added world.rayCast and world.rayCastAll functions.
https://p5play.org/docs/World.html#rayCast

Demo:
https://aijs.io/editor?user=quinton-ashley&project=p5play_world_rayCast_demo

Added world.physicsTime and world.realTime

Added sprite.distanceTo
https://p5play.org/docs/Sprite.html#distanceTo

Thanks to @codingMASTER398 for his help and PR #314 !

3.20.3

Fixed bug with frameRate function override.

3.20.2

Fixed bug that caused sprite.mass setter to crash due to changes in v3.20.1. Oof my bad, I didn't consider it.

Also sprite.resetMass will now only reset the sprite's mass, not its center of mass.

3.20.1

The renderStats function is now deprecated in favor of setting a boolean property p5play.renderStats. This makes it easier to render stats, no need to run renderStats every frame, its much better to just be able to toggle it on and off, which can simply be done in the console. renderStats didn't actually draw the stats anyways, it just set a flag for p5play to draw them after the user's draw loop and all sprites were drawn.

Fixed #312. In p5play my goal was always to have the sprite's center (position), center of mass, and center of rotation all be the same point. So to ensure this is true, addCollider will not change the sprite's center of mass. Users can then use a separate function for that: resetCenterOfMass

Also I tweaked sprite.rotate so that it will not snap to the angle amount prematurely. It also will slow the sprite on the last frame of rotation if the remaining angular distance is not divisible by the rotation speed. This prevents the sprite from having to rotationally teleport too far, ideally a negligible amount or not at all, when set to the exact destination angle. The v3.20.0 implmentation broke my hourglass demo, now it's working great!

3.20.0

Fixed renderStats crashing if not used on frame 1.