|
|
|
sprite movement according to mouseV
Added on 7/20/1999
|
makes a sprite (s) moves up or down and constrained horisontally to invisible line/sprite
property constrainstsprite
property stageWidth
property stageMiddle
property Speed
property Speedincrement
on beginsprite me
set Speedincrement = Speed
set stageWidth = the stagebottom- the stagetop
set stageMiddle = stageWidth/2
set the constraint of sprite(me.spriteNum)=(me.constrainstsprite)
end beginsprite
on enterframe me
if the mouseV < stageMiddle then
set amountToMove= (stageMiddle + the mouseV)/Speedincrement
set the loch of sprite(me.spriteNum) = the loch of sprite (me.spriteNum) + amountToMove
end if
if the mouseV > stageMiddle then
set amountToMove= (stageMiddle - the mouseV)/Speedincrement
set the loch of sprite(me.spriteNum)= the loch of sprite(me.spriteNum) + amountToMove
end if
end enterframe me
on getPropertyDescriptionList
set p_list = [¬
#Speed : [#comment:"Speed in pixels", #format: #float, #range: [#min: 3, #max: 20], #default:"11"], ¬
#constrainstsprite: [#comment:"constrainer Spritenumber", #format: #integer, #default: "15"]]
return p_list
end getPropertyDescriptionList
|
|