quinton-ashley / p5play

JavaScript game engine that uses q5.js/p5.js for graphics and Box2D for physics.
https://p5play.org
GNU Affero General Public License v3.0
667 stars 184 forks source link

Always attempt to draw sprites with custom draw functions #315

Closed quinton-ashley closed 7 months ago

quinton-ashley commented 7 months ago

Discord user @ metamere: "Oh, I have a more important issue than those, since the method I went with worked fine. I moved the ship in my game to a custom draw function, and it works as it should when I run it on my PC in VS code, using the version of p5play I downloaded, 3.2. When I run the same code using the version at https://p5play.org/v3/p5play.js, which is what I had it set to on Openprocessing, now when my ship goes off-screen, it stops drawing the lines connecting it to the sprites on-screen. Do you know what is causing that behavior and if there is a way to prevent it? Or will I just have to take those elements out of the draw function? I assume it was done in the name of efficiency, but it may have had unintended consequences."

Me: "ah interesting. Yeah that's done for better performance, to prevent pre-drawing calculations and drawing of offscreen sprites. I didn't consider that custom drawn sprites may have parts that are much bigger than the collider. For sprites with a custom draw function perhaps I should have p5play always attempt to draw them."

quinton-ashley commented 7 months ago

fixed in v3.20.8