Project1

标题: 新的死法.......- -`|||(更新了一个分成2半的东西``) [打印本页]

作者: 神思    时间: 2006-11-11 08:33
标题: 新的死法.......- -`|||(更新了一个分成2半的东西``)
就是类似仙剑那样..死了之后不是红光一闪..而是直接..升天- -`|||||
其实只是重新定义collapse而已..............
  1. module RPG
  2.   class Sprite < ::Sprite   
  3.     def initialize(viewport = nil)
  4.       super(viewport)
  5.       @_whiten_duration = 0
  6.       @_appear_duration = 0
  7.       @_escape_duration = 0
  8.       @_collapse_duration = 0
  9.       @_damage_duration = 0
  10.       @_animation_duration = 0
  11.       @_blink = false
  12.       @coll_time = 0
  13.     end
  14.     def collapse
  15.       @coll.dispose if @coll != nil
  16.       @coll = Sprite.new
  17.       @coll.bitmap = Bitmap.new("Graphics/Battlers/#{@battler_name}")
  18.       @coll.ox = self.ox
  19.       @coll.oy = self.oy
  20.       @coll.opacity = 100
  21.       @coll.z = 0
  22.       @coll.blend_type = 1
  23.       @coll.x = self.x
  24.       @coll.y = self.y
  25.       @coll_time = 42
  26.       @_whiten_duration = 0
  27.       @_appear_duration = 0
  28.       @_escape_duration = 0
  29.     end
  30.   def update
  31.       super
  32.       if @_whiten_duration > 0
  33.         @_whiten_duration -= 1
  34.         self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  35.       end
  36.       if @_appear_duration > 0
  37.         @_appear_duration -= 1
  38.         self.opacity = (16 - @_appear_duration) * 16
  39.       end
  40.       if @_escape_duration > 0
  41.         @_escape_duration -= 1
  42.         self.opacity = 256 - (32 - @_escape_duration) * 10
  43.       end
  44.       if @coll_time > 0
  45.         @coll_time -= 1
  46.         @coll.y = self.y - (48 - @coll_time) * 6
  47.         self.opacity = 256 - (48 - @coll_time) * 6
  48.         if @coll_time == 0
  49.           @coll.dispose
  50.         end
  51.       end
  52.       if @_damage_duration > 0
  53.         @_damage_duration -= 1
  54.         case @_damage_duration
  55.         when 38..39
  56.           @_damage_sprite.y -= 2
  57.         when 36..37
  58.           @_damage_sprite.y -= 4
  59.         when 34..35
  60.           @_damage_sprite.y -= 2
  61.         when 28..33
  62.           @_damage_sprite.y -= 4
  63.         end
  64.         @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
  65.         if @_damage_duration == 0
  66.           dispose_damage
  67.         end
  68.       end
  69.       if @_animation != nil and (Graphics.frame_count % 2 == 0)
  70.         @_animation_duration -= 1
  71.         update_animation
  72.       end
  73.       if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  74.         update_loop_animation
  75.         @_loop_animation_index += 1
  76.         @_loop_animation_index %= @_loop_animation.frame_max
  77.       end
  78.       if @_blink
  79.         @_blink_count = (@_blink_count + 1) % 32
  80.         if @_blink_count < 16
  81.           alpha = (16 - @_blink_count) * 6
  82.         else
  83.           alpha = (@_blink_count - 16) * 6
  84.         end
  85.         self.color.set(255, 255, 255, alpha)
  86.       end
  87.       @@_animations.clear
  88.     end
  89.   end
  90. end
复制代码



分成2半
  1. module RPG
  2.   class Sprite < ::Sprite   
  3.     def initialize(viewport = nil)
  4.       super(viewport)
  5.       @_whiten_duration = 0
  6.       @_appear_duration = 0
  7.       @_escape_duration = 0
  8.       @_collapse_duration = 0
  9.       @_damage_duration = 0
  10.       @_animation_duration = 0
  11.       @_blink = false
  12.       @coll_time = 0
  13.     end
  14.     def collapse
  15.       @coll.dispose if @coll != nil
  16.       @coll = Sprite.new
  17.       @coll.bitmap = Bitmap.new("Graphics/Battlers/#{@battler_name}")
  18.       @coll.ox = self.ox
  19.       @coll.oy = self.oy
  20.       @coll.opacity = 100
  21.       @coll.z = 0
  22.       w = @coll.bitmap.width
  23.       h = @coll.bitmap.height
  24.       @coll.x = self.x
  25.       @coll.y = self.y + h/2
  26.       @coll.src_rect = Rect.new(0,h/2,w,h)
  27.       @collq.dispose if @collq != nil
  28.       @collq = Sprite.new
  29.       @collq.bitmap = Bitmap.new("Graphics/Battlers/#{@battler_name}")
  30.       @collq.ox = self.ox
  31.       @collq.oy = self.oy
  32.       @collq.opacity = 255
  33.       @collq.z = 0
  34.       @collq.x = self.x
  35.       @collq.y = self.y
  36.       @collq.src_rect = Rect.new(0,0,w,h/2)
  37.       @coll_time = 42
  38.       @_whiten_duration = 0
  39.       @_appear_duration = 0
  40.       @_escape_duration = 0
  41.     end
  42.   def update
  43.       super
  44.       if @_whiten_duration > 0
  45.         @_whiten_duration -= 1
  46.         self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  47.       end
  48.       if @_appear_duration > 0
  49.         @_appear_duration -= 1
  50.         self.opacity = (16 - @_appear_duration) * 16
  51.       end
  52.       if @_escape_duration > 0
  53.         @_escape_duration -= 1
  54.         self.opacity = 256 - (32 - @_escape_duration) * 10
  55.       end
  56.       if @coll_time > 0
  57.         self.opacity = 0
  58.         @coll_time -= 1
  59.         @coll.x = self.x + (42 - @coll_time) * 16
  60.         @collq.x = self.x - (42 - @coll_time) * 16
  61.         @coll.opacity = 256 - (42 - @coll_time) * 16
  62.         @collq.opacity = 256 - (42 - @coll_time) * 16
  63.         #@collq.opacity = 256 - (42 - @coll_time) * 16
  64.         if @coll_time == 0
  65.           @coll.dispose
  66.         end
  67.       end
  68.       if @_damage_duration > 0
  69.         @_damage_duration -= 1
  70.         case @_damage_duration
  71.         when 38..39
  72.           @_damage_sprite.y -= 2
  73.         when 36..37
  74.           @_damage_sprite.y -= 4
  75.         when 34..35
  76.           @_damage_sprite.y -= 2
  77.         when 28..33
  78.           @_damage_sprite.y -= 4
  79.         end
  80.         @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
  81.         if @_damage_duration == 0
  82.           dispose_damage
  83.         end
  84.       end
  85.       if @_animation != nil and (Graphics.frame_count % 2 == 0)
  86.         @_animation_duration -= 1
  87.         update_animation
  88.       end
  89.       if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  90.         update_loop_animation
  91.         @_loop_animation_index += 1
  92.         @_loop_animation_index %= @_loop_animation.frame_max
  93.       end
  94.       if @_blink
  95.         @_blink_count = (@_blink_count + 1) % 32
  96.         if @_blink_count < 16
  97.           alpha = (16 - @_blink_count) * 6
  98.         else
  99.           alpha = (@_blink_count - 16) * 6
  100.         end
  101.         self.color.set(255, 255, 255, alpha)
  102.       end
  103.       @@_animations.clear
  104.     end
  105.   end
  106. end
复制代码




效果如图


嗯 ..大概就是这样```

              [本贴由 雷欧纳德 于 2006-11-20 19:18:29 进行了编辑]
作者: 神思    时间: 2006-11-11 08:33
标题: 新的死法.......- -`|||(更新了一个分成2半的东西``)
就是类似仙剑那样..死了之后不是红光一闪..而是直接..升天- -`|||||
其实只是重新定义collapse而已..............
  1. module RPG
  2.   class Sprite < ::Sprite   
  3.     def initialize(viewport = nil)
  4.       super(viewport)
  5.       @_whiten_duration = 0
  6.       @_appear_duration = 0
  7.       @_escape_duration = 0
  8.       @_collapse_duration = 0
  9.       @_damage_duration = 0
  10.       @_animation_duration = 0
  11.       @_blink = false
  12.       @coll_time = 0
  13.     end
  14.     def collapse
  15.       @coll.dispose if @coll != nil
  16.       @coll = Sprite.new
  17.       @coll.bitmap = Bitmap.new("Graphics/Battlers/#{@battler_name}")
  18.       @coll.ox = self.ox
  19.       @coll.oy = self.oy
  20.       @coll.opacity = 100
  21.       @coll.z = 0
  22.       @coll.blend_type = 1
  23.       @coll.x = self.x
  24.       @coll.y = self.y
  25.       @coll_time = 42
  26.       @_whiten_duration = 0
  27.       @_appear_duration = 0
  28.       @_escape_duration = 0
  29.     end
  30.   def update
  31.       super
  32.       if @_whiten_duration > 0
  33.         @_whiten_duration -= 1
  34.         self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  35.       end
  36.       if @_appear_duration > 0
  37.         @_appear_duration -= 1
  38.         self.opacity = (16 - @_appear_duration) * 16
  39.       end
  40.       if @_escape_duration > 0
  41.         @_escape_duration -= 1
  42.         self.opacity = 256 - (32 - @_escape_duration) * 10
  43.       end
  44.       if @coll_time > 0
  45.         @coll_time -= 1
  46.         @coll.y = self.y - (48 - @coll_time) * 6
  47.         self.opacity = 256 - (48 - @coll_time) * 6
  48.         if @coll_time == 0
  49.           @coll.dispose
  50.         end
  51.       end
  52.       if @_damage_duration > 0
  53.         @_damage_duration -= 1
  54.         case @_damage_duration
  55.         when 38..39
  56.           @_damage_sprite.y -= 2
  57.         when 36..37
  58.           @_damage_sprite.y -= 4
  59.         when 34..35
  60.           @_damage_sprite.y -= 2
  61.         when 28..33
  62.           @_damage_sprite.y -= 4
  63.         end
  64.         @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
  65.         if @_damage_duration == 0
  66.           dispose_damage
  67.         end
  68.       end
  69.       if @_animation != nil and (Graphics.frame_count % 2 == 0)
  70.         @_animation_duration -= 1
  71.         update_animation
  72.       end
  73.       if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  74.         update_loop_animation
  75.         @_loop_animation_index += 1
  76.         @_loop_animation_index %= @_loop_animation.frame_max
  77.       end
  78.       if @_blink
  79.         @_blink_count = (@_blink_count + 1) % 32
  80.         if @_blink_count < 16
  81.           alpha = (16 - @_blink_count) * 6
  82.         else
  83.           alpha = (@_blink_count - 16) * 6
  84.         end
  85.         self.color.set(255, 255, 255, alpha)
  86.       end
  87.       @@_animations.clear
  88.     end
  89.   end
  90. end
复制代码



分成2半
  1. module RPG
  2.   class Sprite < ::Sprite   
  3.     def initialize(viewport = nil)
  4.       super(viewport)
  5.       @_whiten_duration = 0
  6.       @_appear_duration = 0
  7.       @_escape_duration = 0
  8.       @_collapse_duration = 0
  9.       @_damage_duration = 0
  10.       @_animation_duration = 0
  11.       @_blink = false
  12.       @coll_time = 0
  13.     end
  14.     def collapse
  15.       @coll.dispose if @coll != nil
  16.       @coll = Sprite.new
  17.       @coll.bitmap = Bitmap.new("Graphics/Battlers/#{@battler_name}")
  18.       @coll.ox = self.ox
  19.       @coll.oy = self.oy
  20.       @coll.opacity = 100
  21.       @coll.z = 0
  22.       w = @coll.bitmap.width
  23.       h = @coll.bitmap.height
  24.       @coll.x = self.x
  25.       @coll.y = self.y + h/2
  26.       @coll.src_rect = Rect.new(0,h/2,w,h)
  27.       @collq.dispose if @collq != nil
  28.       @collq = Sprite.new
  29.       @collq.bitmap = Bitmap.new("Graphics/Battlers/#{@battler_name}")
  30.       @collq.ox = self.ox
  31.       @collq.oy = self.oy
  32.       @collq.opacity = 255
  33.       @collq.z = 0
  34.       @collq.x = self.x
  35.       @collq.y = self.y
  36.       @collq.src_rect = Rect.new(0,0,w,h/2)
  37.       @coll_time = 42
  38.       @_whiten_duration = 0
  39.       @_appear_duration = 0
  40.       @_escape_duration = 0
  41.     end
  42.   def update
  43.       super
  44.       if @_whiten_duration > 0
  45.         @_whiten_duration -= 1
  46.         self.color.alpha = 128 - (16 - @_whiten_duration) * 10
  47.       end
  48.       if @_appear_duration > 0
  49.         @_appear_duration -= 1
  50.         self.opacity = (16 - @_appear_duration) * 16
  51.       end
  52.       if @_escape_duration > 0
  53.         @_escape_duration -= 1
  54.         self.opacity = 256 - (32 - @_escape_duration) * 10
  55.       end
  56.       if @coll_time > 0
  57.         self.opacity = 0
  58.         @coll_time -= 1
  59.         @coll.x = self.x + (42 - @coll_time) * 16
  60.         @collq.x = self.x - (42 - @coll_time) * 16
  61.         @coll.opacity = 256 - (42 - @coll_time) * 16
  62.         @collq.opacity = 256 - (42 - @coll_time) * 16
  63.         #@collq.opacity = 256 - (42 - @coll_time) * 16
  64.         if @coll_time == 0
  65.           @coll.dispose
  66.         end
  67.       end
  68.       if @_damage_duration > 0
  69.         @_damage_duration -= 1
  70.         case @_damage_duration
  71.         when 38..39
  72.           @_damage_sprite.y -= 2
  73.         when 36..37
  74.           @_damage_sprite.y -= 4
  75.         when 34..35
  76.           @_damage_sprite.y -= 2
  77.         when 28..33
  78.           @_damage_sprite.y -= 4
  79.         end
  80.         @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
  81.         if @_damage_duration == 0
  82.           dispose_damage
  83.         end
  84.       end
  85.       if @_animation != nil and (Graphics.frame_count % 2 == 0)
  86.         @_animation_duration -= 1
  87.         update_animation
  88.       end
  89.       if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
  90.         update_loop_animation
  91.         @_loop_animation_index += 1
  92.         @_loop_animation_index %= @_loop_animation.frame_max
  93.       end
  94.       if @_blink
  95.         @_blink_count = (@_blink_count + 1) % 32
  96.         if @_blink_count < 16
  97.           alpha = (16 - @_blink_count) * 6
  98.         else
  99.           alpha = (@_blink_count - 16) * 6
  100.         end
  101.         self.color.set(255, 255, 255, alpha)
  102.       end
  103.       @@_animations.clear
  104.     end
  105.   end
  106. end
复制代码




效果如图


嗯 ..大概就是这样```

              [本贴由 雷欧纳德 于 2006-11-20 19:18:29 进行了编辑]
作者: 新手上陆    时间: 2006-11-11 08:39
提示: 作者被禁止或删除 内容自动屏蔽
作者: 神思    时间: 2006-11-11 08:40
应该不会有任何冲突的说..............
作者: link006007    时间: 2006-11-11 08:41
更改一下死亡对象精灵的横纵比会更有趣的~~
zoom_x=,zoom_y=...~
作者: 神思    时间: 2006-11-11 08:42
扭曲的灵魂`- -`|||...
作者: 新手上陆    时间: 2006-11-11 08:56
提示: 作者被禁止或删除 内容自动屏蔽
作者: 神思    时间: 2006-11-11 09:01
- -`|这样啊.....

在@coll.bitmap = Bitmap.new下面加一行
@coll.src_rect = Rect.new(0,0,宽,高)
这样就好了..根据战斗图的行和列来设置宽高吧`
作者: 新手上陆    时间: 2006-11-11 09:07
提示: 作者被禁止或删除 内容自动屏蔽
作者: 柳柳    时间: 2006-11-11 11:34
再做两个吧:
一个是横腰斩断成俩bitmap
一个是变成很多小方块飞散
作者: 冰月小助    时间: 2006-11-11 12:48
提示: 作者被禁止或删除 内容自动屏蔽
作者: xuelong    时间: 2006-11-11 13:50
提示: 作者被禁止或删除 内容自动屏蔽
作者: 397897143    时间: 2006-11-11 13:57
     我也支持下..不过我是新手,还不会自己制作..{/ll}
作者: 冰月小助    时间: 2006-11-11 15:32
提示: 作者被禁止或删除 内容自动屏蔽
作者: 小传子    时间: 2006-11-11 16:01
以下引用link006007于2006-11-11 0:41:38的发言:

更改一下死亡对象精灵的横纵比会更有趣的~~
zoom_x=,zoom_y=...~

{/pz}{/pz}经典
不过思思写的还真好 收下了
作者: KarEE    时间: 2006-11-11 16:28
提示: 作者被禁止或删除 内容自动屏蔽
作者: 絮儿    时间: 2006-11-11 16:31
以下引用KarEE于2006-11-11 8:28:46的发言:

居然給樓主想到這樣的死法...蠻不錯的,支持。

这个MS是新仙剑的死法哦~{/hx}
嗯……仙剑快要被完全复刻出来了~~
作者: 神思    时间: 2006-11-11 22:29
以下引用柳柳于2006-11-11 3:34:38的发言:

再做两个吧:
一个是横腰斩断成俩bitmap
一个是变成很多小方块飞散

分成2个很容易...但是方块对我来说好象有点困难....我试下看``

作者: 3389942    时间: 2006-11-11 23:30
以下引用柳柳于2006-11-11 3:34:38的发言:

再做两个吧:
一个是横腰斩断成俩bitmap
一个是变成很多小方块飞散

你说的是  天之痕
的那种死法吧!
那个挺好的!
被刀砍死的有的分成好几段,有的分成两段
被爆炸魔法或其他魔法打死了,就想分成很多小方块飞散
被冰系魔法打死了,先全身变淡蓝色然后碎掉

作者: 神思    时间: 2006-11-11 23:34

不行..做不来...本来打算生成大量的bitmap....结果直接卡死.............
作者: 美兽    时间: 2006-11-11 23:35
以下引用神思于2006-11-11 14:29:19的发言:


以下引用柳柳于2006-11-11 3:34:38的发言:

再做两个吧:
一个是横腰斩断成俩bitmap
一个是变成很多小方块飞散


分成2个很容易...但是方块对我来说好象有点困难....我试下看``


两个与很多方块的原理应该差不多.

其实可以再试试让精灵转两圈....
作者: 神思    时间: 2006-11-11 23:37

{/gg}上面那个2半其实只是生成2张图...然后....................
方块不能这么做。...会直接卡死`
作者: link006007    时间: 2006-11-11 23:40
以下引用神思于2006-11-11 15:34:46的发言:


不行..做不来...本来打算生成大量的bitmap....结果直接卡死.............

不知道这样行不行:
在初始化时就直接先生成这些bitmap的空间,到时只要赋值就可以了,这样应该就不会因为生成
bitmap而卡吧...? 就好像先把位图放在Cache里一样... (不过够让费内存的)
作者: 姬文翔    时间: 2006-11-11 23:43
华丽地死去~{/se}爽啊!
作者: 轮回者    时间: 2006-11-11 23:45
以下引用神思于2006-11-11 15:34:46的发言:


不行..做不来...本来打算生成大量的bitmap....结果直接卡死.............

预先生成N多,死了调用一下
作者: 轮回者    时间: 2006-11-11 23:46
以下引用link006007于2006-11-11 15:40:07的发言:


以下引用神思于2006-11-11 15:34:46的发言:


不行..做不来...本来打算生成大量的bitmap....结果直接卡死.............


不知道这样行不行:
在初始化时就直接先生成这些bitmap的空间,到时只要赋值就可以了,这样应该就不会因为生成
bitmap而卡吧...? 就好像先把位图放在Cache里一样... (不过够让费内存的)



同~{/cy}

作者: orochi2k    时间: 2006-11-12 02:35
开始有随机collapse的想法了...呵呵
作者: 冰月小助    时间: 2006-11-21 20:25
提示: 作者被禁止或删除 内容自动屏蔽
作者: 神思    时间: 2006-11-21 20:30
以下引用冰月小助于2006-11-21 12:25:03的发言:

我发现他会和彩虹神剑起冲突耶!!!!

-___-`||那你就把这个东西看明白``.然后整合起来吧。...改动的地方其实不多`
作者: 冰月小助    时间: 2006-11-21 20:33
提示: 作者被禁止或删除 内容自动屏蔽
作者: 小湖    时间: 2006-11-22 03:19
能不能有轩辕剑3那种华丽的死法………………

不知道可不可以运用到地图事件上…………
作者: 冰月小助    时间: 2006-11-22 03:29
提示: 作者被禁止或删除 内容自动屏蔽
作者: 小湖    时间: 2006-11-22 03:33
可怜的NPC们啊{/gg}
作者: DQRPG    时间: 2006-11-23 02:15
{/pz}{/pz} 和彩虹神剑冲突,有高手能解决一下吗?{/hx}
作者: PlayerLin    时间: 2006-11-23 06:32
好東西!
覺得RMXP原來也可以做到這樣的~~ {/cy}
呃...
目前發現跟 擊中感 腳本衝到-.-+
作者: kakarott    时间: 2006-11-25 03:36
高手们好啊,这个要复制到哪啊?
作者: 黄成越r    时间: 2006-12-2 20:15
虽然不太完美,但还是顶一下~
作者: titiannongfu    时间: 2006-12-23 23:32
提示: 作者被禁止或删除 内容自动屏蔽
作者: 柳柳    时间: 2006-12-25 09:26
以下引用titiannongfu于2006-12-23 15:32:41的发言:

请问插在哪里啊?
以下引用kakarott于2006-11-24 19:36:20的发言:

高手们好啊,这个要复制到哪啊?

注意这个是module的基本修改,所以使用当然是随意插在任何地方都可以。




以下引用DQRPG于2006-11-22 18:15:41的发言:

和彩虹神剑冲突,有高手能解决一下吗?
以下引用PlayerLin于2006-11-22 22:32:08的发言:

好東西!
覺得RMXP原來也可以做到這樣的~~
呃...
目前發現跟 擊中感 腳本衝到-.-+

这是正常的。注意如果同时脚本中定义了重名的函数部分,如<::Sprite的,那么肯定是互相覆盖冲突的。
作者: linyijian    时间: 2007-2-4 00:24
效果不错,45度战斗更好
作者: 秋弦月    时间: 2007-3-20 06:06
{/hx}有创意那。。。。刚才看了下,升天的效果还真好玩。。。。
作者: 4262130    时间: 2007-4-9 19:00
提示: 作者被禁止或删除 内容自动屏蔽
作者: gpra8764    时间: 2007-4-10 03:45
提示: 作者被禁止或删除 内容自动屏蔽
作者: 神思    时间: 2007-4-10 06:06
{/gg}不是的```你可以看一下编辑日期``已经是N久前的东西了```只是一直沉不下去```
作者: 萧萧无痕    时间: 2007-5-10 08:50
提示: 作者被禁止或删除 内容自动屏蔽
作者: 宾少    时间: 2007-8-22 09:46
请问一下,升天的那个.能不能直接弄成:怪物死后,直接由怪物本身变透明向上飘?
作者: 菜鸟笨鸟傻鸟    时间: 2007-8-23 21:26
提示: 作者被禁止或删除 内容自动屏蔽
作者: 鬥转星移    时间: 2007-8-26 22:17
无语!~
作者: 黑鏻    时间: 2007-8-27 16:36
不知能不能设置怪物死后不是升天(作恶多端还想升天?!),而是变成幽灵缠住自己~~~
还可以设置被幽灵缠住会怎么样???缠住的几率???驱除幽灵的办法???

请问这些能不能做出来呢???
作者: doranikofu    时间: 2007-8-27 18:46
其实天之痕那种粉碎似效果也不错{/hx} 飘~
作者: Apollo    时间: 2008-2-27 03:31
楼主 是把module RPG
  class Sprite < ::Sprite   
    def initialize(viewport = nil)
      super(viewport)
      @_whiten_duration = 0
      @_appear_duration = 0
      @_escape_duration = 0
      @_collapse_duration = 0
      @_damage_duration = 0
      @_animation_duration = 0
      @_blink = false
      @coll_time = 0
    end
    def collapse
      @coll.dispose if @coll != nil
      @coll = Sprite.new
      @coll.bitmap = Bitmap.new("Graphics/Battlers/#{@battler_name}")
      @coll.ox = self.ox
      @coll.oy = self.oy
      @coll.opacity = 100
      @coll.z = 0
      @coll.blend_type = 1
      @coll.x = self.x
      @coll.y = self.y
      @coll_time = 42
      @_whiten_duration = 0
      @_appear_duration = 0
      @_escape_duration = 0
    end
  def update
      super
      if @_whiten_duration > 0
        @_whiten_duration -= 1
        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
      end
      if @_appear_duration > 0
        @_appear_duration -= 1
        self.opacity = (16 - @_appear_duration) * 16
      end
      if @_escape_duration > 0
        @_escape_duration -= 1
        self.opacity = 256 - (32 - @_escape_duration) * 10
      end
      if @coll_time > 0
        @coll_time -= 1
        @coll.y = self.y - (48 - @coll_time) * 6
        self.opacity = 256 - (48 - @coll_time) * 6
        if @coll_time == 0
          @coll.dispose
        end
      end
      if @_damage_duration > 0
        @_damage_duration -= 1
        case @_damage_duration
        when 38..39
          @_damage_sprite.y -= 2
        when 36..37
          @_damage_sprite.y -= 4
        when 34..35
          @_damage_sprite.y -= 2
        when 28..33
          @_damage_sprite.y -= 4
        end
        @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
        if @_damage_duration == 0
          dispose_damage
        end
      end
      if @_animation != nil and (Graphics.frame_count % 2 == 0)
        @_animation_duration -= 1
        update_animation
      end
      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
        update_loop_animation
        @_loop_animation_index += 1
        @_loop_animation_index %= @_loop_animation.frame_max
      end
      if @_blink
        @_blink_count = (@_blink_count + 1) % 32
        if @_blink_count < 16
          alpha = (16 - @_blink_count) * 6
        else
          alpha = (@_blink_count - 16) * 6
        end
        self.color.set(255, 255, 255, alpha)
      end
      @@_animations.clear
    end
  end
end
这些东西复制在Main前面吗?还是需要在某个脚本里用这些东西更换其它的东西?
其它知道的朋友也告诉我一下谢谢
作者: 陆亚    时间: 2008-2-27 18:21
提示: 作者被禁止或删除 内容自动屏蔽
作者: 冰城飞狐    时间: 2008-2-27 20:53
像天之痕那样……炸开!
作者: swabwind    时间: 2008-2-28 07:40
可以做成多桢动画了吧。。。如果能做成梦幻和魔力那样子飞出屏幕外那种效果就好玩了{/tx}




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1