幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2016|回复: 1

[RMXP] 循环动画自动隐去脚本,如何改成挨打方不隐去?

[复制链接]

3

主题

3

帖子

212

积分

③业余

积分
212
发表于 2014-6-22 22:57:46 | 显示全部楼层 |阅读模式
用一个【正常】状态来添加循环待机动画。当使用了状态循环动画,攻击的时候,状态动画并不会消失(也就是屏
幕上同时播放循环动画和攻击动画,貌似角色分身的样子)。
用了这个循环动画自动隐去脚本.攻击方和挨打方状态循环动画都给同时隐去.请问如何改成挨打方循环动画不隐去
?攻击方隐去谢谢.


#==============================================================================

#==============================================================================
module RPG
class Sprite < ::Sprite
   def animation_set_sprites(sprites, cell_data, position, invisible = false)
     if invisible
       for i in 0..15
         sprites.visible = false
       end
       return
     end
     for i in 0..15
       sprite = sprites
       pattern = cell_data[i, 0]
       if sprite == nil or pattern == nil or pattern == -1
         sprite.visible = false if sprite != nil
         next
       end
       sprite.visible = true
       sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
       if position == 3
         if self.viewport != nil
           sprite.x = self.viewport.rect.width / 2
           sprite.y = self.viewport.rect.height - 160
         else
           sprite.x = 320
           sprite.y = 240
         end
       else
         sprite.x = self.x - self.ox + self.src_rect.width / 2
         sprite.y = self.y - self.oy + self.src_rect.height / 2
         sprite.y -= self.src_rect.height / 4 if position == 0
         sprite.y += self.src_rect.height / 4 if position == 2
       end
       sprite.x += cell_data[i, 1]
       sprite.y += cell_data[i, 2]
       sprite.z = 2000
       sprite.ox = 96
       sprite.oy = 96
       sprite.zoom_x = cell_data[i, 3] / 100.0
       sprite.zoom_y = cell_data[i, 3] / 100.0
       sprite.angle = cell_data[i, 4]
       sprite.mirror = (cell_data[i, 5] == 1)
       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
       sprite.blend_type = cell_data[i, 7]
     end
   end
   def update_loop_animation
     if @_animation_duration > 0
       frame_index = @_loop_animation_index
       cell_data = @_loop_animation.frames[frame_index].cell_data
       position = @_loop_animation.position
       animation_set_sprites(@_loop_animation_sprites, cell_data, position,true)

     else
       frame_index = @_loop_animation_index
       cell_data = @_loop_animation.frames[frame_index].cell_data
       position = @_loop_animation.position
       animation_set_sprites(@_loop_animation_sprites, cell_data, position)
       for timing in @_loop_animation.timings
         if timing.frame == frame_index
           animation_process_timing(timing, true)
         end
       end
     end
   end
end
end
#=================
回复

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2014-6-23 13:39:38 | 显示全部楼层
你用了好多脚本吧,需要交互作用吧。。。只贴这个,谁知道是啥腌T_Tbbbb
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2024-3-29 22:09 , Processed in 0.018823 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表