Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
CD Everywhere
Billenium Transitions Xtra
MouseWheel
sound volum
Set Castmember properties for DirectMedia member
Streaming Media
Importing bitmaps without loosing white space
Rollover Swirl-Alphamania
Spawn
EZIO
MediaMacros Xtras Mall
 

 

 

Behavior Ripple Rain-Alphamania

Added on 6/10/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

Required Xtras:
Alphamania
Effector Set II for Alphamania

This item has not yet been rated

Author: MediaLab (website)

Requires Effector Set 2

property sNum
property speed -- how often do they fall?
property spriteHeight, spriteWidth -- dimensions of sprite
property lastRainTick -- last time a drop fell
property onlyWhileMouseOver -- only generate ripples while over, pauseEffect otherwise
property paused -- generate ripples or not

on getBehaviorDescription me
  return "This behavior will place random ripples on the sprite to generate a rain effect."
end

on getPropertyDescriptionList me
  set list = [:]
  addProp list, #speed, [#comment: "Speed:", #format: #integer, #default: 60, #range: [#max: 100, #min:1]]
  addProp list, #onlyWhileMouseOver , [#comment: "Only While Mouse Over", #format: #boolean, #default: FALSE]
  return list
end

on beginSprite me
  set sNum = the spriteNum of me
  set spriteWidth = the width of sprite sNum
  set spriteHeight = the height of sprite sNum
  set lastRainTick = 0
  ripple(sprite sNum)
  if onlyWhileMouseOver then
    if not rollover(sNum) then
      PauseEffect(sprite sNum, #ripple)
      exit
    end if
  end if
  Add(the actorList, me)
end

on endSprite me
  set pos =   getone(the actorList, me)
  if pos then
    deleteAt(the actorList, pos)
  end if
end

on stepFrame me
  set nextRainTick = lastRainTick + 101 - speed
  if the ticks >= nextRainTick then  -- time for another drop
    RainDrop(me)
    set lastRainTick = the ticks
  end if
end

on RainDrop me, h, v
  if integerP(h) then
    set x = h
  else
    set x = random(spriteWidth)
  end if
  if integerP(v) then
    set y = v
  else
    set y = random(spriteHeight)
  end if
  
  ripple(sprite sNum, [#xLocation: x, #yLocation: y])
end


on StopEffect me, sym
  -- removes this behavior from the actorList
  if not voidP(sym) then
    if sym <> #ripple then exit
  end if
  set pos =   getone(the actorList, me)
  if pos then
    deleteAt(the actorList, pos)
    PauseEffect(sprite sNum, #ripple)
  end if
end

on ResumeEffect me, sym
  -- adds this behavior to the actorList
  if not voidP(sym) then
    if sym <> #ripple then exit
  end if
  set pos =   getone(the actorList, me)
  if pos = 0 then
    Add(the actorList, me)
    ContinueEffect(sprite sNum, #ripple)
  end if
end

on mouseEnter me
  if onlyWhileMouseOver then
    ResumeEffect(me)
  end if
end

on mouseLeave me
  if onlyWhileMouseOver then
    StopEffect(me)
  end if
end

 


Upload Provided by ABCUpload ASP

Contact

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

Fax - (206) 339-5833

Send e-mail