thelastflapjack / godot_open_target_shooter

An open source third person shooter time trial game made with Godot 3.5
MIT License
50 stars 6 forks source link

refactored/improved main scene #2

Closed DissonantVoid closed 2 years ago

DissonantVoid commented 2 years ago

I did some refactoring that I think makes more sense, of course feel free to reject any change you don't like I'm just trying to help :)

-removed _current_scene variable in favor of get_tree().current_scene, this is more of a standard way of doing it according to the docs, as it doesn't break functions like get_tree().change_scene() and get_tree().reload_current_scene -remove frame dependent interactive loading, frame dependency is very much always a bad idea, I added a timer instead. not sure why you want to wait for some time before calling _loader.poll(), but I kept your idea anyway -made it so that fade rect blocks the mouse while the fade animation is playing, this prevents user from clicking stuff while screen is fading -some other refactoring and removing of unnecessary code

thelastflapjack commented 2 years ago

Your contribution is very welcome and appreciated, this does seem like a more sensible way to do it. It has been a while since I looked at this code, I think I first used it some time last year and haven't really looked at it since then. I did some searching and I think it is a modified version of what is described on this doc page.

Thanks.

DissonantVoid commented 2 years ago

Happy to help! I saw your project on Reddit and couldn't resist messing arround with the source code and learning from it as well