Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
MIAW Event Leak
Copy Keydown Script
FreePPP Control
Graph Class
EZIO
Rotate Click-Alphamania
Populate MS Combo Box ActiveX
TrackTheColors Xtra Error
PDF Publishing in Multimedia Projects
KeyboardControl Xtra Standard
MediaMacros Xtras Mall
 

 

 

Behavior sprite movement according to mouseV

Added on 7/20/1999

 

Compatibilities:
behavior D7 D8 Mac PC

This item has not yet been rated

Author: StanleyWidjaja

makes a sprite (s) moves up or down and constrained horisontally to invisible line/sprite

property constrainstsprite
property stageWidth
property stageMiddle
property Speed
property Speedincrement




on beginsprite me
  set Speedincrement                     = Speed
  set stageWidth                         = the stagebottom- the stagetop
  set stageMiddle                        = stageWidth/2
  set the constraint of sprite(me.spriteNum)=(me.constrainstsprite)
end beginsprite

on enterframe me  
  if the mouseV <  stageMiddle then
    set  amountToMove= (stageMiddle + the mouseV)/Speedincrement
    set the loch of sprite(me.spriteNum) = the loch of sprite (me.spriteNum) + amountToMove
  end if
  
  if the mouseV > stageMiddle then
    set  amountToMove= (stageMiddle - the mouseV)/Speedincrement
    set the loch of sprite(me.spriteNum)= the loch of sprite(me.spriteNum) + amountToMove
  end if
end enterframe me



on getPropertyDescriptionList
  set p_list = [¬
  #Speed            :   [#comment:"Speed in pixels", #format: #float, #range: [#min: 3, #max: 20], #default:"11"], ¬
  #constrainstsprite:   [#comment:"constrainer Spritenumber", #format: #integer, #default: "15"]]
  return p_list
end getPropertyDescriptionList

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail