设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1750|回复: 6
打印 上一主题 下一主题

关于战斗动画设置

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-23
帖子
24
跳转到指定楼层
1
发表于 2007-8-25 01:39:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-23
帖子
24
2
 楼主| 发表于 2007-8-25 01:39:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv3.寻梦者

梦石
1
星屑
916
在线时间
101 小时
注册时间
2006-3-27
帖子
1081
3
发表于 2007-8-25 07:48:30 | 只看该作者
这个- -|

MS一般是这个做发射状,再淡化

然后挨打动画那边再做个激光出现……HIT……就好了

中间就54掉吧,看不出来的- -|
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-23
帖子
24
4
 楼主| 发表于 2007-8-25 18:52:11 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
676
在线时间
224 小时
注册时间
2006-12-7
帖子
839
5
发表于 2007-8-25 23:07:44 | 只看该作者
选画面的话

人跑到画面中间去发射激光了。  
----------------
选画面 然后把动画往左平移{/gg}
回复 支持 反对

使用道具 举报

Lv1.梦旅人

66RPG站长

梦石
0
星屑
54
在线时间
615 小时
注册时间
2005-10-10
帖子
5734

RMVX自由创作大赛亚军第2届短篇游戏比赛亚军第5届短篇游戏比赛冠军

6
发表于 2007-8-27 21:07:35 | 只看该作者
如果你的人物是固定的位置就比较简单:分两段做:一个是人物发射激光,一个是画面的激光飞舞。

否则的话也有一些别的办法,比如对特定动画设置一个偏移。主要在module RPG里面的Animation和Sprite < ::Sprite里面。我们可以进行修改,然后用“发动特技,100”来控制播放的时候动画播放位置比数据库设置时候的中心位置偏移100象素。



做了一个简单的范例工程如下:
http://rpg.blue/upload_program/files/Project_shift_animation.rar



脚本如下(修改的地方已经标注出来了):
  1. module RPG
  2.   class Animation      
  3.     # --------------------------------------
  4.     # 添加一个根据动画名称决定的偏移X的变量
  5.     # --------------------------------------
  6.     def shift_x
  7.       return @name.split(/,/)[1] != nil ? @name.split(/,/)[1].to_i : 0
  8.     end
  9.   end
  10.   
  11.   
  12.   class Sprite < ::Sprite
  13.     def initialize(viewport = nil)
  14.       super(viewport)
  15.       @_whiten_duration = 0
  16.       @_appear_duration = 0
  17.       @_escape_duration = 0
  18.       @_collapse_duration = 0
  19.       @_damage_duration = 0
  20.       @_animation_duration = 0
  21.       @_blink = false
  22.       
  23.       # ---------------------------------
  24.       # 添加一个偏移X的变量
  25.       # ---------------------------------
  26.       @_animation_shiftx = 0
  27.       
  28.     end
  29.    
  30.     def animation(animation, hit)
  31.       dispose_animation
  32.       @_animation = animation      
  33.       
  34.       # ---------------------------------
  35.       # 读取偏移X的变量
  36.       # ---------------------------------
  37.       @_animation_shift_x = animation.shift_x
  38.       
  39.       return if @_animation == nil
  40.       @_animation_hit = hit
  41.       @_animation_duration = @_animation.frame_max
  42.       animation_name = @_animation.animation_name
  43.       animation_hue = @_animation.animation_hue
  44.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  45.       if @@_reference_count.include?(bitmap)
  46.         @@_reference_count[bitmap] += 1
  47.       else
  48.         @@_reference_count[bitmap] = 1
  49.       end
  50.       @_animation_sprites = []
  51.       if @_animation.position != 3 or not @@_animations.include?(animation)
  52.         for i in 0..15
  53.           sprite = ::Sprite.new(self.viewport)
  54.           sprite.bitmap = bitmap
  55.           sprite.visible = false
  56.           @_animation_sprites.push(sprite)
  57.         end
  58.         unless @@_animations.include?(animation)
  59.           @@_animations.push(animation)
  60.         end
  61.       end
  62.       update_animation
  63.     end
  64.    
  65.     def animation_set_sprites(sprites, cell_data, position)
  66.       for i in 0..15
  67.         sprite = sprites[i]
  68.         pattern = cell_data[i, 0]
  69.         if sprite == nil or pattern == nil or pattern == -1
  70.           sprite.visible = false if sprite != nil
  71.           next
  72.         end
  73.         sprite.visible = true
  74.         sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
  75.         if position == 3
  76.           if self.viewport != nil
  77.             sprite.x = self.viewport.rect.width / 2
  78.             sprite.y = self.viewport.rect.height - 160
  79.           else
  80.             sprite.x = 320
  81.             sprite.y = 240
  82.           end
  83.         else
  84.           sprite.x = self.x - self.ox + self.src_rect.width / 2
  85.           sprite.y = self.y - self.oy + self.src_rect.height / 2
  86.           sprite.y -= self.src_rect.height / 4 if position == 0
  87.           sprite.y += self.src_rect.height / 4 if position == 2
  88.         end
  89.         #-------------------------------------------------
  90.         # 给动画的X添加偏移
  91.         #-------------------------------------------------
  92.         sprite.x += cell_data[i, 1] + @_animation_shift_x
  93.         
  94.         sprite.y += cell_data[i, 2]
  95.         sprite.z = 2000
  96.         sprite.ox = 96
  97.         sprite.oy = 96
  98.         sprite.zoom_x = cell_data[i, 3] / 100.0
  99.         sprite.zoom_y = cell_data[i, 3] / 100.0
  100.         sprite.angle = cell_data[i, 4]
  101.         sprite.mirror = (cell_data[i, 5] == 1)
  102.         sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  103.         sprite.blend_type = cell_data[i, 7]
  104.       end
  105.     end
  106.    
  107.   end
  108. end
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

6R文字专区写手

梦石
0
星屑
50
在线时间
15 小时
注册时间
2007-5-11
帖子
1486
7
发表于 2007-8-27 21:42:43 | 只看该作者
用齐时战斗分两个动画,一个攻击者动画一个被攻击者动画就OK了,实在不行我QQ教你
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2026-6-24 06:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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