Keeping score between two cards

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Bobby666
Posts: 8
Joined: Mon Dec 30, 2013 6:59 pm

Keeping score between two cards

Post by Bobby666 » Sat Jan 04, 2014 9:31 pm

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:)

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Keeping score between two cards

Post by jmburnod » Sat Jan 04, 2014 11:44 pm

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
https://alternatic.ch

Bobby666
Posts: 8
Joined: Mon Dec 30, 2013 6:59 pm

Re: Keeping score between two cards

Post by Bobby666 » Sun Jan 05, 2014 5:05 pm

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 :(

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Keeping score between two cards

Post by Klaus » Sun Jan 05, 2014 5:21 pm

HI Bobby,

check this thread, I think this is your problem:
http://forums.runrev.com/phpBB2/viewtop ... are#p87045


Best

Klaus

Bobby666
Posts: 8
Joined: Mon Dec 30, 2013 6:59 pm

Re: Keeping score between two cards

Post by Bobby666 » Mon Jan 06, 2014 9:40 pm

Thank you very much! That was my problem! :D

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Keeping score between two cards

Post by Klaus » Mon Jan 06, 2014 11:23 pm

Hey, cool, I'm making progress in "clairvoyance"! :D

Post Reply