Game development: how to move to the next level
Posted: Sat May 30, 2020 1:23 pm
Hello, I'm developing an education app for kids and I can't figure out what code I need to type to make the submarine ask: "Is my path clear?", and if there is an object that is not hidden besides the background and the submarine and you press yes then it types "Incorrect" and how many objects are left.
but if there are no objects left*1 then it adds a point and goes to the next level, and if I press no and there are objects left then it types "correct" but it doesn't add a point
help please,
kid-developer
here's the code of one of the objects:
*1the object becomes hidden when you answer correctly, and again besides the submarine and background
but if there are no objects left*1 then it adds a point and goes to the next level, and if I press no and there are objects left then it types "correct" but it doesn't add a point
help please,
kid-developer
here's the code of one of the objects:
Code: Select all
global _gUserScore
on mouseUp
PinkJellyfishQuestion
end mouseUp
on PinkJellyfishQuestion
answer "Is my color pink?" with "Yes" or "No"
if it is "Yes"
then
AddPoints
answer "correct" with "yay"
hide me
save this stack
else
answer "try again please"
end if
end PinkJellyfishQuestion
on AddPoints
add 1 to _gUserScore
put _gUserScore into field "userScore"
end AddPoints