set the locH of sprite the spriteNum of me = pMyXpos
set the locV of sprite the spriteNum of me = pMyYpos
add(the actorList, me)
end
on endSprite me
deleteOne(the actorList,me)
end
--
on stepFrame me
if pMyDirection = "Right" then
set pMyXpos = pMyXpos + pSpeed
else
set pMyXpos = pMyXpos - pSpeed
end if
set stageWidth = the stageRight - the stageLeft
if pMyDirection = "Right" then
if pMyXpos > stageWidth then
set pMyXpos = 0
end if
else
if pMyXpos < 0 then
set pMyXpos = stageWidth
end if
end if
set the locH of sprite (the spriteNum of me) = pMyXpos
set x = the locH of sprite the spriteNum of me
set the locV of sprite (the spriteNum of me) = ¬
pMyYpos + integer(float(pAmplitude*(sin((float(pMyXpos)/float(pPeriod))*PI))))
set y = the locV of sprite the spriteNum of me
updateStage
end
on getPropertyDescriptionList me
set propList = [#pMyXpos: [#comment: "Startposition X (in pixels)", #format: #integer,¬
#default: 0], #pMyYpos: [#comment: "Startposition Y (in pixels)", #format: #integer,¬
#default: 0], #pSpeed: [#comment: "Speed", #range: [1,2,3,4,5,6,7,8,9,10], #format: #integer,¬
#default: 5], #pAmplitude: [#comment: "Aplitude", #format: #integer, #default: 30], ¬
#pPeriod: [#comment: "Period", #format: #integer, #default: 50], ¬
#pMyDirection: [#comment:"Which direction?", #range: ["Left", "Right"], #format: #string,¬
#default: "Right"]]
return propList
end