v3.7
3.7.13
Sensors can be added to a sprite with a collider type of "none". I also added a new function addSensor
which adds overlap sensors to a sprite. I added removeColliders
and removeSensors
but these functions completely remove colliders/sensors so in most cases it's better to use collision functions like collides
to disable, without entirely removing, overlap sensors, and vice versa, use overlap functions like overlaps
to disable colliders.
3.7.11
Bug fix for group collisions and overlaps. Sprites could not begin contact with a group on the same frame as ending contact with another sprite in the same group.
3.7.10
User's can now set the camera's position in the p5.js setup function.
3.7.8
In previous versions there was no way to disable an overlap between sprites/groups, without changing the sprite's collider type. A student of @bobby S. suggested that overlaps could be disabled by explicitly checking for a collision and vice versa. Now why hadn't I thought of that!? 🧠 🧐
Check out the new "ghost ability" example! 👻
https://p5play.org/learn/sprite.html?page=6
3.7.7
I added a new "made with p5play" intro loading screen, similar to Unity's. But don't worry, it won't show up when you're developing with p5play in VSCode or any popular online code editor. I wanted to keep the loading screen simple but at least making it more interesting and professional looking than p5.js' basic "...loading" text.
What better way to unveil this new feature than with two of my favorite projects that were made with p5play: @axiom's "Squirrel" art and @Nitmay's "Red Remover" game!
https://quinton-ashley.github.io/Squirrel/Code/index.html
https://thegamebox.ca/redremover.html
3.7.6
I added a new sprite property called pixelPerfect for displaying sprites at integer coordinates, while retaining the precise position of the sprite's collider. Useful for pixel art games! 👾
3.7.3
Bug fix. Adding an image/animation to a sprite that has no specified dimensions should change it's dimensions.
3.7.2
Bug fix for when a sprite's dimensions are not defined in the constructor, then the user would expect the mass to change after they define the sprite's dimensions.
3.7.0
Performance improvements!
Collision and overlap handling in p5play (not talking about the physics solver here) is now faster. Behind the scenes of functions like overlaps
I was using JS Map. Each sprite and group had a map, and these maps used, as keys, the sprites/groups that the sprite/group overlapped with. But, I found out that getting and setting object properties that use integers as keys is nearly twice as fast! So now each sprite and group have unique ids for use in these objects.
Also now when a sprite gets removed that was previously colliding or overlapping with another sprite, it will still trigger collided
and overlapped
callbacks if it has any.