加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 刺夜之枪 于 2014-4-6 13:05 编辑
#============================================================================== # ■ EFS_Arrow #------------------------------------------------------------------------------ # 定义弓箭失的类 #============================================================================== class EFS_Arrow < Sprite #-------------------------------------------------------------------------- # ● 定义类变量 #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- # ● 初始化数据 #-------------------------------------------------------------------------- def initialize(viewport) super(viewport) @direction = 2 end #-------------------------------------------------------------------------- # ● 发射箭失 #-------------------------------------------------------------------------- def display(fighter) #必须是Fighter.event @direction = fighter.event.direction @x = fighter.event.x*32 - 34 @y = fighter.event.y*32 - 68 if self.bitmap==nil self.bitmap=RPG::Cache.character("arrow",0) self.x = @x self.y = @y self.ox = $game_map.display_x / 4 self.oy = $game_map.display_y / 4 self.src_rect.set(0,(@direction/2-1)*100, 100, 100) end end end
#==============================================================================
# ■ EFS_Arrow
#------------------------------------------------------------------------------
# 定义弓箭失的类
#==============================================================================
class EFS_Arrow < Sprite
#--------------------------------------------------------------------------
# ● 定义类变量
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# ● 初始化数据
#--------------------------------------------------------------------------
def initialize(viewport)
super(viewport)
@direction = 2
end
#--------------------------------------------------------------------------
# ● 发射箭失
#--------------------------------------------------------------------------
def display(fighter) #必须是Fighter.event
@direction = fighter.event.direction
@x = fighter.event.x*32 - 34
@y = fighter.event.y*32 - 68
if self.bitmap==nil
self.bitmap=RPG::Cache.character("arrow",0)
self.x = @x
self.y = @y
self.ox = $game_map.display_x / 4
self.oy = $game_map.display_y / 4
self.src_rect.set(0,(@direction/2-1)*100, 100, 100)
end
end
end
主要是加入这句话就有问题了
self.src_rect.set(0,(@direction/2-1)*100, 100, 100)
顺便再来三提问,
XXXXX(已经解决)
还有一个是这些箭都比事件显示的图层高,,, 怎么改成和事件一样的
ruby怎么做cos 或者 sin之类的逆运算
|