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
Flash Development
Get CD ROM Drive letter
createSpecList
Vector Shape - Create Polygon
Grabbing the Stage (D7)
replace escape characters
Puzzling!
TetonPop Xtra
Roil Button-Alphamania
Asteroids game behaviour
 

 

 

Behavior Planet Orbiter

Added on 6/10/1999

 

Compatibilities:
behavior D6_5 Mac PC

This item has not yet been rated

Author: KatsumiIshida

Planet Orbiter

property pSun
property pSpeed
property pRadian
property pRadius
property p2PI

on getPropertyDescriptionList
  set p_list = [#pSun: [ #comment: "Origin of orbit (sprite #):", #format: #integer, #default:  1  ] , #pSpeed: [ #comment: "Speed",  #format: #integer,  #default:  1 ]  ]
  return p_list
end

on getBehaviorDescription
  return "written by Katsumi Ishida. (C) 1997/09/19 Katsumi Ishida"
end

on beginSprite me
  set sp = the spriteNum of me
  set pRadian = 0.0
  set xy = the loc of sprite sp - the loc of sprite pSun
  set xy = xy * xy
  set pRadius = sqrt( the locH of xy + the locV of xy )
  set p2PI = 2 * pi()
  puppetSprite sp, true
end
on endSprite me
  set sp = the spriteNum of me
  puppetSprite sp, false
  set pRadian = void
  set pRadius = void
  set p2PI = void
end

on exitFrame me
  set sp = the spriteNum of me
  set pRadian = pRadian + pSpeed * 0.1
  if (p2PI < pRadian) then set pRadian = pRadian - p2PI
  set Sun2Planet = point( pRadius * cos( pRadian ), pRadius * sin( pRadian ) )
  set the loc of sprite sp = Sun2Planet + the loc of sprite pSun
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail