Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
PDF Class
Particle Explosion Effect
Vector Shape - Create Star
TextCruncher
ProgressCopy
JTMR KoolMarquee
Index Xtra
W3D Texture Extractor
Set PlayBackMode Property of a Animated Gif Cast Member
SpriteMap
 

 

 

Behavior Orbiter

Added on 6/7/1999

 

Compatibilities:
behavior D6_5 Mac PC

This item has not yet been rated

Author: RenfieldFeinstein

The Orbital Behavor as hacked by Renfield ren@core-ad.co.jp with respect to flat earth communications

property spriteNum
property orbitSpeed, originH, originV, radiusH, radiusV, originType, originSprite

--======  The Set Up:

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

Send e-mail