Adding Levels To a Game

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jizzle
Posts: 10
Joined: Fri Mar 16, 2012 4:31 pm

Adding Levels To a Game

Post 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? :)
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Adding Levels To a Game

Post 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
jizzle
Posts: 10
Joined: Fri Mar 16, 2012 4:31 pm

Re: Adding Levels To a Game

Post by jizzle »

Thanks a lot. I have the different cards scripts already done so will have a try and see how this works.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Adding Levels To a Game

Post 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
jizzle
Posts: 10
Joined: Fri Mar 16, 2012 4:31 pm

Re: Adding Levels To a Game

Post 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
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Adding Levels To a Game

Post 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
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Adding Levels To a Game

Post 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
Post Reply