HOW CAN U KEEP SCORE FOR A TRIVIA GAME?.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jerrettajGAb6ba
Posts: 9
Joined: Mon Dec 05, 2011 5:33 pm

HOW CAN U KEEP SCORE FOR A TRIVIA GAME?.

Post by jerrettajGAb6ba » Sat Dec 17, 2011 1:24 am

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...

josephreesGA75ef
Posts: 22
Joined: Mon Dec 05, 2011 5:33 pm

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

Post by josephreesGA75ef » Sat Dec 17, 2011 1:56 am

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.

jerrettajGAb6ba
Posts: 9
Joined: Mon Dec 05, 2011 5:33 pm

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

Post by jerrettajGAb6ba » Sat Dec 17, 2011 2:19 am

Hello.. josephreesGA75ef

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


Thanks... for responding...

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

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

Post by dunbarx » Sat Dec 17, 2011 3:57 am

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

Post Reply