At 9:28 PM -0700 10/16/00, Samu wrote:
>Hello everyone
>
> I am attempting to make a small quiz with director
>but I encounter one problem. In the movie there is a
>energy bar that reduces every time a user answer one
>question wrongly. so I've got 5 cast member of the
>energy bar "eb5/5, eb4/5, eb3/5, eb2/5, eb1/5" but I
>need a script to make the sprite to count the time
>that the "you are wrong" frame or the "you are wrong"
>cast's time of appearing. so everytime the fram or
>cast is seen, the energy bar will change from 5/5 to
>4/5 to 3/5....so forth,,, is that possible? and if
>there's an easier way to make that happen I am really
>greatful to get some help... Thanks a lot for ya times
>on reading this mail anyways,,,,
Samu,
It's not clear to me from your description if the energy bar is on
screen all the time, or comes and goes. If it's on screen all the
time, you could use one behavior. if not, you need some type of
global that keeps track of the number of "lives" left (e.g.,
gNumberOfLivesLeft). Here's two little movie script level routines
to call
-- Initialize the quiz
global gNumberOfLivesLeft
on startQuiz
gNumberOfLivesLeft = 5
end
-- call this when the user gets one wrong
on gotOneWrong
gNumberOfLivesLeft = gNumberOfLivesLeft - 1
-- Check for zero and do something here
end
Then put any of the bars (e.g., eb5/5) in the score and attach a
script like this:
global gNumberOfLivesLeft
property spriteNum
on beginSprite me
whichBar = "eb" & string(gNumberOfLivesLeft) & "/5"
sprite(spriteNum).member = whichBar
end
Should give you a start ...
Irv
--
Lingo / Director / Shockwave development for all occasions.
(Over two millions lines of Lingo code served!)
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]