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

20. Strings Lesson 2 Issue with different variable names.

Open 228Q922 opened this issue 1 year ago • 1 comments

All animations play out in the correct order. The error statement given was telling me my animations aren't playing out supposedly due to me not calling the function. Code and log below:

func run(): combo = ["jab", "jab", "uppercut"] for number in combo: play_animation (number)

gdquest-1722187700109.log

228Q922 avatar Jul 28 '24 17:07 228Q922

The Issue you have is due to an whitespace between "play_animation" and "(number)".

play_animation (number)

without a whitespace it should work

play_animation(number)

Wolfy7 avatar Oct 16 '24 09:10 Wolfy7

I added a new function to preprocess code and ignore whitespace in tests. Ideally this could/would be used everywhere automatically, it's something we use now in GDPractice to make checking code syntax a bit more reliable, but well a change like this would need careful testing and perhaps some refactoring. So for now it's only used here and can be used in specific practices when people have trouble.

NathanLovato avatar Oct 22 '24 07:10 NathanLovato