Page 1 of 1

Adding Levels To a Game

Posted: Fri Mar 16, 2012 4:35 pm
by jizzle
HI all,
I am new to livecode and have developed a simple game. Im looking to transfer between levels in the game which will be on different cards in my stack but im not sure how to go about it. I was thinking of a bit of code to make a button appear after a set time or for the card to automatically change after a set time or reaching a set score...can anyone help please? :)

Re: Adding Levels To a Game

Posted: Fri Mar 16, 2012 6:34 pm
by dunbarx
Hi.

Have you written any scripts yet? Do you know what a message is? Does this make sense:

Code: Select all

on openCard
  wait 10 seconds
  go card 2
end opencard
Write back if this is old hat, completely unintelligible, or somewhere in the middle.

The good news is that you have found the right tool for the job.

Craig Newman

Re: Adding Levels To a Game

Posted: Sun Mar 18, 2012 11:01 pm
by jizzle
Thanks a lot. I have the different cards scripts already done so will have a try and see how this works.

Re: Adding Levels To a Game

Posted: Sun Mar 18, 2012 11:36 pm
by dunbarx
Terrific.

Read in the dictionary about the "send" command, especially its "send in time" variant. You may not need this now, but I bet it will come in handy if you want to make an invisible object appear after a set time. There are dozens of ways of detecting and acting on a value reached in a field. To really have fun, try to make this aspect of your game work in three different ways.

Write back with your progress.

Craig Newman

Re: Adding Levels To a Game

Posted: Mon Mar 19, 2012 12:36 pm
by jizzle
Thanks for the help.... I've tried the wait code but that doesn't allow the game to play it just waits and goes to the next card. Do you have any ideas so I can get it to work off a score or wait a set amount of time and still play the game whilst it's waiting.

Thanks
James

Re: Adding Levels To a Game

Posted: Mon Mar 19, 2012 3:59 pm
by dunbarx
Yes, "wait" locks everything up for the duration. It has its uses, but in your case is not the way to go. It was just an example. Wherever you used that command, you might substitute a "send in time" command instead. This will take a little practice, but allows interaction through the duration.

How is the number in your field updated? Are you OK with the mechanics of your game but just having trouble with the card change? How is the time thing integrated into the working of the game itself?

All your issues can be solved with a few short scripts. I am just not sure what to help you with yet.

Craig Newman

Re: Adding Levels To a Game

Posted: Mon Mar 19, 2012 4:05 pm
by Klaus
Hi jizzle,

I removed your double posting, please only one thread per question, thanks!,
and will move this one to the correct forum!


Best

Klaus