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
EzeeAlert
Developing Projects Using Director and ASP
Media Player
SpellerRT
KeyboardControl Xtra Lite
List of Globals
Message Box Behavior
Non-repeating random list
FFT
ProFusion Xtra for Authorware and Director
 

 

 

Behavior Full control of sprite

Added on 9/8/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: SunilBalan

Just drop this behaviour on your sprite and get the movement horizontally, vertically or by rotating clockwise or anticlockwise.

-- compiled by Sunil Balan
-- sunilbalan@usa.net

property pControl, spritenum, pRange

on getPropertyDescriptionList
  set description = [:]
  addProp description, #pControl,[#comment: "Select the movement :", #format:#String,#range:["Rotate","Move horizontally", "Move vertically"], #default:"Move horizontally"]
  addProp description, #pRange, [#comment: "Select your speed :", #format:#Integer, #range:[#min:-10,#Max:10],#default:1]
  return description
end

on exitframe me
  Case (pControl) of
    "Rotate":
      sprite(me.spritenum).rotation = sprite(me.spritenum).rotation + pRange
    "Move horizontally":
      sprite(me.spritenum).loch = sprite(me.spritenum).loch + pRange
    "Move vertically" :
      sprite(me.spritenum).locv = sprite(me.spritenum).locv + pRange
  End Case
end

 


Contact

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

Send e-mail