Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Word of Mouth Productions #1
Re: Help creating randomly falling sprites with lingo
Attach the following behavior to each sprite that's to fall. Adjust the
pSpeed parameter to make the objects fall faster or slower. Adjust the
pInterval to determine how long an object waits at the top of the screen
before it starts falling. The setting of the locH is restricted to the width
of the stage so you might want to change that in the two places it's done if
you want the objects falling within a certain range of the stage other than
the whole stage.
property pS, spriteNum, pInterval, pStartPause, pMode, pSpeed
on beginSprite me
pS = sprite (spriteNum)
pInterval = random (3) -- seconds
pStartPause = the ticks
pMode = #wait
pSpeed = random (20) + 5
pS.locV = - pS.height
pS.locH = random (the stageRight - the stageLeft)
end
on exitFrame me
case pMode of
#wait:
if the ticks > pStartPause + pInterval * 60 then
pMode = #falling
end if
#falling:
if pS.top < the stageBottom then
pS.locV = pS.locV + pSpeed
else
pMode = #reset
end if
#reset:
pS.locV = - pS.height
pS.locH = random (the stageRight - the stageLeft)
pMode = #wait
pStartPause = the ticks
end case
end
--
Craig Wollman
Word of Mouth Productions
phone 212 724 8302
fax 212 724 8151
[url]www.wordofmouthpros.com[/url]
"Opyuse" <webforumsuser@macromedia.com> wrote in message
news:bh59af$njg$1@forums.macromedia.com...the lingo to get this to happen.> I have to make a game with randomly falling sprites but I can't work out>
> Any help you can give will be great?
>
> Thank you
>
>
>
Word of Mouth Productions Guest
-
lingo to put sprites on stage
what is the lingo syntax to put a sprite on stage other than using OOP methods?? -
Need a way to control de rotation (angle) of sprites through Lingo
I'm setting up a system made of wheels which have to rotate at variable speeds. I'm planning to control this using the angle of the sprite, but... -
Using lingo to resize sprites
I have a cast of 52 cards (it is sprites of a deck of cards). I was wondering if there was a way that on preparemovie or on beginsprite I could use... -
Using Lingo to stop sprites from scrolling at a certain point.
Hi All, I have a project I'm working on. Basically, I have 10 sprites that move horizontally left or right when moused over. The problem I have... -
More Help needed with the randomly falling sprites
Eariler I asked for help with randomly falling sprites and I was given the code below. However now I'm getting the following error message when I... -
Opyuse webforumsuser@macromedia.com #2
Re: Help creating randomly falling sprites with lingo
Thanks alot thats great
Opyuse webforumsuser@macromedia.com Guest
-
Opyuse webforumsuser@macromedia.com #3
Re: Help creating randomly falling sprites with lingo
Sorry about this but when I entered the code you gave this error message appeared
Variable used before assigned a value
case pMode of?
How do I get rid of this error?
Opyuse webforumsuser@macromedia.com Guest
-
Mark A. Boyd #4
Re: Help creating randomly falling sprites with lingo
On 10 Aug 2003, "Opyuse" [email]webforumsuser@macromedia.com[/email] wrote:
You forgot the line of code that declares the property variables. Put this> Variable used before assigned a value
> case pMode of?
>
> How do I get rid of this error?
at the top of the script (outside of any handlers)
property pS, spriteNum, pInterval, pStartPause, pMode, pSpeed
--
Mark A. Boyd
Keep-On-Learnin' :)
Mark A. Boyd Guest
-
Word of Mouth Productions #5
Re: Help creating randomly falling sprites with lingo
Thanks Mark
--
Craig Wollman
Word of Mouth Productions
phone 212 724 8302
fax 212 724 8151
[url]www.wordofmouthpros.com[/url]
"Mark A. Boyd" <mblists@sanDotrr.com> wrote in message
news:Xns93D367CFACE5FmblistssanDotrrcom@65.57.83.2 09...> On 10 Aug 2003, "Opyuse" [email]webforumsuser@macromedia.com[/email] wrote:
>>> > Variable used before assigned a value
> > case pMode of?
> >
> > How do I get rid of this error?
> You forgot the line of code that declares the property variables. Put this
> at the top of the script (outside of any handlers)
>
> property pS, spriteNum, pInterval, pStartPause, pMode, pSpeed
>
>
>
> --
> Mark A. Boyd
> Keep-On-Learnin' :)
Word of Mouth Productions Guest



Reply With Quote

