learn-gdscript icon indicating copy to clipboard operation
learn-gdscript copied to clipboard

Lesson 13: Preventing Health From Going Below Zero, missing health variable in text.

Open rizaerdibahar opened this issue 1 year ago • 2 comments

In "Lesson 13: Preventing Health From Going Below Zero", goals text dont give information for variable health. If defined in code by user, it gives errors. I suggest adding a text regarding "variable health" is predefined by you.

failure success

rizaerdibahar avatar Dec 27 '24 14:12 rizaerdibahar

if you declare a variable inside a function, that variable only exists within the function. I believe for the purposes of this exercise, you should use the robot's health variable, as declaring a var inside the function would not modify the robot's actual health. @NathanLovato

StanleyAlbayeros avatar Oct 11 '25 09:10 StanleyAlbayeros

Yes, that's correct.

I would say it's more of a general issue that would need to be handled throughout the app as this applies to many practices: ideally we'd expose member variables in all practices, and also protect against their deletion or shadowing with a clear feedback message to the user (like we do in our newer practice system GDPractice/in our Godot 4 curriculum).

There are a couple of holistic changes like these that the app could use, but it's a really substantial amount of work.

NathanLovato avatar Oct 11 '25 11:10 NathanLovato