Project1
标题:
怎么同时执行 攻击方动画 和 被攻击动画 …
[打印本页]
作者:
杀幻
时间:
2008-7-13 06:14
提示:
作者被禁止或删除 内容自动屏蔽
作者:
殲滅天使·玲
时间:
2008-7-13 06:42
主战上有一个脚本 配合全动画战斗能弄出LZ要的效果
很多全动画战斗的脚本都使用了那个
这个插在全动画脚本前
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
module RPG
class Sprite < ::Sprite
def animation_set_sprites(sprites, cell_data, position, invisible = false)
if invisible
for i in 0..15
sprites[i].visible = false
end
return
end
for i in 0..15
sprite = sprites[i]
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
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
全动画脚本的地址 :
http://rpg.blue/web/htm/news729.htm
目前我只发现站上有这种
不用全动画战斗实现 我也不知道 或者等高人回答- -
作者:
redant
时间:
2008-7-13 07:07
LS 请教那个脚本 是干什么用的{/jy}
全动画脚本是 攻击方动画 是空白的 也就是等待的帧
只有对象方 动画 是有主角(人物)去攻击 然后返回
http://rpg.blue/web/htm/news729.htm 去下他的范例工程 看看 就明白了
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1