Going to the next card.

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
slwatkins21
Posts: 3
Joined: Thu Mar 12, 2015 7:27 am

Going to the next card.

Post by slwatkins21 » Tue Mar 24, 2015 7:33 am

I have it to where on mouseUp, a balloon follows along a line down.

What I want to do is once it has gone down, the card goes to the next card.

Any ideas on how to do that? I'm not sure how to code it in.

Here's what I have so far:
-image script

Code: Select all

on mouseUp
   move image "hot air balloon 1.png" to the points of graphic "line" in 2 seconds without waiting
end mouseUp
-card script

Code: Select all

on preOpenCard
   set the location of image "hot air balloon 1.png" to 1085,134
end preOpenCard

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Going to the next card.

Post by Simon » Tue Mar 24, 2015 8:11 am

Hi slwatkins21,
Does the balloon follow a straight vertical direction? It doesn't have to but makes it easy.

Code: Select all

local goNow
on mouseUp
   if goNow = true then
      put false into goNow
   else put true into goNow
   moveImage
end mouseUp

on moveImage
   if goNow = true then
      if the bottom of image "hot air balloon 1.png" <= the bottom of this card then
         set the bottom of image "hot air balloon 1.png" to the bottom of image "hot air balloon 1.png" +5 --this replaces the move command
      else 
         go cd "next card"
      end if
      send moveImage to me in 30 millisecs --the cool bit
   end if
end moveImage
Ok that is a game loop (well for this exercise).
Make sense?

Oh, and I very much dislike spaces in names, maybe not today but some day, it will bite you.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply