on idle me
checkOrigin me
orbit me
updateStage
end
on exitFrame me
checkOrigin me
orbit me
end
--====== Making Biscuits:
on checkOrigin me
case (originType) of
"mouse": mouseOrigin me
"sprite": spriteOrigin me
end case
end
on mouseOrigin me
set originH = the mouseh
set originV = the mousev
end
on spriteOrigin
set originH = the loch of sprite originSprite
set originV = the locv of sprite originSprite
end
on orbit me
set counter to the ticks
set the loch of sprite spriteNum = originH + radiusH * cos(counter/orbitSpeed)
set the locv of sprite spriteNum = originV +radiusV * sin(counter/orbitSpeed)
end
--====== Behavior Handlers:
on getPropertyDescriptionList me
set theProps to [:]
set c to "What"s the orbit speed?"
set f to #float
set d to 50.00
addProp theProps, #orbitSpeed, [#comment: c, #format: f, #default: d]
set c to "What"s the origin?"
set f to #string
set r to ["point", "mouse", "sprite"]
set d to getAt(r,1)
set typeProps to [#comment: c, #format: f, #range: r, #default: d]
addProp theProps, #originType, typeProps
set c to "If origin is a sprite, who?"
set f to #integer
set d to 1
addProp theProps, #originSprite, [#comment: c, #format: f, #default: d]
set c to "If origin is a point, what"s H?"
set f to #integer
set d to 100
addProp theProps, #originH, [#comment: c, #format: f, #default: d]
set c to "if origin is a point,what"s V?"
set f to #integer
set d to 100
addProp theProps, #originV, [#comment: c, #format: f, #default: d]
set c to "What"s the H radius?"
set f to #integer
set d to 30
addProp theProps, #radiusH, [#comment: c, #format: f, #default: d]
set c to "What"s the V radius?"
set f to #integer
set d to 30
addProp theProps, #radiusV, [#comment: c, #format: f, #default: d]
return theProps
end
on getBehaviorDescription me
set line1 to " Make an orbiter" & RETURN
return line1
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA