Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- Timed Enemy Drops v1.1
- Made by: Sixth
- Just a little snippet to make the enemy drops timed in Falcao's ABS.
- Once the timer runs out, the item drop will disappear automatically.
- You can edit the erase timer and the fade out speed at the end of
- the timer as well on the commented lines if you want.
- Put this snippet below the default ABS scripts!
- =end
- class Sprite_EnemyDrop < Sprite
- alias add_erasetime9271 initialize
- def initialize(viewport, event, item)
- @etime = 1200 # Time in frames to stay on screen (60 frames = 1 second)
- @ftime = 60 # Fade out duration in frames.
- add_erasetime9271(viewport, event, item)
- end
- alias upd_erasetime7726 update
- def update
- upd_erasetime7726
- if @etime > 0
- @etime -= 1
- if @etime <= @ftime
- self.opacity -= 255.to_f/@ftime unless self.disposed?
- end
- else
- complete_action(false)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement