Project1
标题:
关于战斗动画设置
[打印本页]
作者:
钱多多
时间:
2007-8-25 01:39
提示:
作者被禁止或删除 内容自动屏蔽
作者:
钱多多
时间:
2007-8-25 01:39
提示:
作者被禁止或删除 内容自动屏蔽
作者:
幻の飞鱼
时间:
2007-8-25 07:48
这个- -|
MS一般是这个做发射状,再淡化
然后挨打动画那边再做个激光出现……HIT……就好了
中间就54掉吧,看不出来的- -|
作者:
钱多多
时间:
2007-8-25 18:52
提示:
作者被禁止或删除 内容自动屏蔽
作者:
doranikofu
时间:
2007-8-25 23:07
选画面的话
人跑到画面中间去发射激光了。
----------------
选画面 然后把动画往左平移{/gg}
作者:
柳柳
时间:
2007-8-27 21:07
如果你的人物是固定的位置就比较简单:分两段做:一个是人物发射激光,一个是画面的激光飞舞。
否则的话也有一些别的办法,比如对特定动画设置一个偏移。主要在module RPG里面的Animation和Sprite < ::Sprite里面。我们可以进行修改,然后用“发动特技,100”来控制播放的时候动画播放位置比数据库设置时候的中心位置偏移100象素。
做了一个简单的范例工程如下:
http://rpg.blue/upload_program/files/Project_shift_animation.rar
脚本如下(修改的地方已经标注出来了):
module RPG
class Animation
# --------------------------------------
# 添加一个根据动画名称决定的偏移X的变量
# --------------------------------------
def shift_x
return @name.split(/,/)[1] != nil ? @name.split(/,/)[1].to_i : 0
end
end
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
# ---------------------------------
# 添加一个偏移X的变量
# ---------------------------------
@_animation_shiftx = 0
end
def animation(animation, hit)
dispose_animation
@_animation = animation
# ---------------------------------
# 读取偏移X的变量
# ---------------------------------
@_animation_shift_x = animation.shift_x
return if @_animation == nil
@_animation_hit = hit
@_animation_duration = @_animation.frame_max
animation_name = @_animation.animation_name
animation_hue = @_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation)
for i in 0..15
sprite = ::Sprite.new(self.viewport)
sprite.bitmap = bitmap
sprite.visible = false
@_animation_sprites.push(sprite)
end
unless @@_animations.include?(animation)
@@_animations.push(animation)
end
end
update_animation
end
def animation_set_sprites(sprites, cell_data, position)
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
#-------------------------------------------------
# 给动画的X添加偏移
#-------------------------------------------------
sprite.x += cell_data[i, 1] + @_animation_shift_x
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
end
end
复制代码
作者:
恺撒亮
时间:
2007-8-27 21:42
用齐时战斗分两个动画,一个攻击者动画一个被攻击者动画就OK了,实在不行我QQ教你
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1