Hey everyone!:)
My question is : How can I keep the score between two cards?
In my game , when the user intersects a "Questionbox" with my player a new card appears with a question , and when the user goes back the the card "Level1" where he intersected the "Questionbox" the score is empty. However he needs a number of "Diamants" to go to the next card. ( The score is in a global variable)
I hope everyone understands my question:)
Thank you for answers:)
Keeping score between two cards
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Keeping score between two cards
Hi,
If the score is in a global variable then you can get it from all script of your stack.
You have simply to declare this global in front of script
Best regards
Jean-Marc
If the score is in a global variable then you can get it from all script of your stack.
You have simply to declare this global in front of script
Best regards
Jean-Marc
https://alternatic.ch
Re: Keeping score between two cards
Hey:)
The problem is I declared this global in front of my script, but when I change the card and i come back the score is empty and the "Diamants" are not visible (what is correct). I don't know why the score is empty:D Livecode says that the code is correct but it doesn't work "correct" for me:D
the code is
on collectD
if intersect (button "mSprite" , button "Diamant" , "pixels" ) then
if enabled of button "Diamant" then
add 1 to numDiamants
put numDiamants into the field "numDiamants"
end if
hide button "Diamant"
disable button "Diamant"
end if
end collectD
It doesn't keep the score
The problem is I declared this global in front of my script, but when I change the card and i come back the score is empty and the "Diamants" are not visible (what is correct). I don't know why the score is empty:D Livecode says that the code is correct but it doesn't work "correct" for me:D
the code is
on collectD
if intersect (button "mSprite" , button "Diamant" , "pixels" ) then
if enabled of button "Diamant" then
add 1 to numDiamants
put numDiamants into the field "numDiamants"
end if
hide button "Diamant"
disable button "Diamant"
end if
end collectD
It doesn't keep the score

Re: Keeping score between two cards
HI Bobby,
check this thread, I think this is your problem:
http://forums.runrev.com/phpBB2/viewtop ... are#p87045
Best
Klaus
check this thread, I think this is your problem:
http://forums.runrev.com/phpBB2/viewtop ... are#p87045
Best
Klaus
Re: Keeping score between two cards
Thank you very much! That was my problem! 

Re: Keeping score between two cards
Hey, cool, I'm making progress in "clairvoyance"! 
