Greetings from Thessaloniki, Greece.
This is actually my first post in the forum. I am a new member of the community.
My question is this:
I am developing an educational game where the student visits 8 countries to gather some data. Everything starts and finishes in an introductory scene where the student chooses in which country to go. When he finishes, he returns to that scene.
I am trying to figure out a way to disable countries visited in previous round with some sort of iteration. Could do that with a bunch of if’s but I’ve come to understand that GDevelop is capable of more than that.
My initial idea was to come up with 8 global variables with value 0 (not visited) which I will change to 1 when the student is done with the country. In a similar vein, I have sprites for country names and flags whose animations have the same name as the global variables.
What I was going for is the following in pseudocode:
At the beginning of the scene
for each of the 8 global variables {
for each of the 8 flag animations {
if (flag animation name == global variable name) && (global variable value == 1) {
show that flag animation at x, y
move x a bit to prepare for next flag
disable country name from options
}
}
}
Is that sth that can be done? Search global variable names by sprite animation names and/or vice versa?
It would require some sort of compare condition which utilizes getters which I don’t know if it is possible or how to code it
if GlobalVariable(Sprite.getAnimationNameAsString()) equals 1
Any help or workaround would be much appreciated