Ask a Question related to Macromedia Director Basics, Design and Development.
-
OrganicJerk_1 #1
Spritr follow mouse with delay..???
This is actually for my roomate, and I'm trying to get rid of his defeatist
attitude...
Can anyone help me with a script or command to have a sprite follow the mouse
cursor, with a Delay.....so basically, it would be as though the sprite were
"chasing" the mouse arrow....slow or regular speed, it wouldn't matter...
Thanks in advance to anyone who can help!
OrganicJerk_1 Guest
-
model to follow mouse
Hi I am creating a shooting game in director 3d. I hve a gun pointer which i want to move along with the mouse. The problem i am facing is i am not... -
3d object to follow the mouse
Hi, anyone know how I can get a 3d model to follow the x,y of the mouse. I need the coordinates translated into 3d.. John -
Please help with follow mouse!
Hello I have a menu with a movie clip that slides following the mouse, up and down The code looks as follows onClipEvent (load) _y = 0 speed =... -
mouse follow problem
my prob: have got a bmp. that zooms on click want 2 have it on click to "move" with a mouse follow 2! it shall move only slowly the prob: -
Follow Mouse script?
Hello, I'm making a navigation bar like on http://www.solangemusic.com/ Could someone tell me the script to make the box move with the mouse?... -
JB #2
Re: Spritr follow mouse with delay..???
-- Here's a behavior for what you described
-- follow mouse with log
property lagFIFO
on beginSprite
lagFIFO = []
end
on prepareFrame me
-- the 10 below establshes the number of frames delay
if count(lagFIFO) >= 10 then deleteAt lagFIFO, count(lagFIFO)
addAt lagFIFO, 1, the mouseLoc
sprite(me.spriteNum).loc = lagFIFO[count(lagFIFO)]
if optiondown() then put lagFIFO
end
-- this is probably more like what is needed
-- ( no mass momentum in this simple one )
-- weak mouse atraction
on prepareFrame me
-- 5 is the lag factor
sprite(me.spriteNum).loc = sprite(me.spriteNum).loc + ( the mouseLoc
- sprite(me.spriteNum).loc) / 5
end
JB Guest



Reply With Quote

