Page 1 of 1

Going to the next card.

Posted: Tue Mar 24, 2015 7:33 am
by slwatkins21
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

Re: Going to the next card.

Posted: Tue Mar 24, 2015 8:11 am
by Simon
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