Alzter / TuxBuilder

A Godot re-implementation of SuperTux
GNU General Public License v3.0
212 stars 28 forks source link

Improve snowball and coin performance with visibility enabler #22

Closed skyace65 closed 5 years ago

skyace65 commented 5 years ago

I've added a visibility enabler to the coin. This means when it isn't on scene it stops animating.

There were several changes to the nowball -I also replaced the Snowballs visibility notifier with a visibility enabler. Like the coin it stops it from animating while it's offscreen. I also set this one to pause the physics process function when it's offscreen which should give better performance. -checking if something is active when it's offscreen is now done using signals so that should help performance as well. -There was also a duplicate line of code I removed. -I removed the old code for killing the snowball when it falls off screen since the visibilityenabler does it now.

Also I don't think setting things as invisible when they're offscreen improves performance so I left it out.