Page 1 of 1

HOW CAN U KEEP SCORE FOR A TRIVIA GAME?.

Posted: Sat Dec 17, 2011 1:24 am
by jerrettajGAb6ba
Hello..

I'm trying to keep score of my trivia game... right now.. Every time the user click the correct answer .. I add 1 to the field Correct.. and the same if the user selects the wrong answer .. I add 1 to the field ..Wrong...

But ..Can't figure how to transfer the sum of the fields.. Correct .. Wrong on to the Next Card... and so on.. and so on...

Thanks

Jerret...

Re: HOW CAN U KEEP SCORE FOR A TRIVIA GAME?.

Posted: Sat Dec 17, 2011 1:56 am
by josephreesGA75ef
Newbie here, but I believe if you want to transfer the values of a variable from card to card, you'd need to declare it as a global variable first. Probably best to do this in the main stack, so that it's available to every subsequent substack or card.

Re: HOW CAN U KEEP SCORE FOR A TRIVIA GAME?.

Posted: Sat Dec 17, 2011 2:19 am
by jerrettajGAb6ba
Hello.. josephreesGA75ef

I'm going to try it out... and see what happens...


Thanks... for responding...

Re: HOW CAN U KEEP SCORE FOR A TRIVIA GAME?.

Posted: Sat Dec 17, 2011 3:57 am
by dunbarx
Hello all.

LiveCode is far nicer than that. No need to declare anything. Read up on the "put" command, the cornerstone of them all.

Make a stack with two cards.
Put a button and a field on card 1. Put some data into that field.
Put a blank field on card 2

Go back to card 1 and put this handler into the button script:

Code: Select all

on mouseUp
   put fld 1 into fld 1 of cd 2
end mouseUp
It is all fun and games from there. You HAVE to play around. Do it al lot.

Craig Newman