#--------------------------------------------------------------------------
# ● 跳跃效果
#--------------------------------------------------------------------------
def update_real_jump
# 如果重力开关关闭则重力失效
if start_can?
return
end
# 如果不在下落时
if @jump_key == true && @isDown == false
@g_key = false
if passable?(@x, @real_y.floor, 8) and @y > 0
if @g_speed_up > 0
@g_speed_up -= @g_height*0.01
@y -= @g_speed_up
@real_y = @y
else
@jump_key = false
@real_y = @real_y
@y = @real_y
@g_key = true
end
else
@jump_key = false
@real_y = @real_y
@y = @real_y
@g_key = true
end
end
end
#--------------------------------------------------------------------------
# ● 重力效果
#--------------------------------------------------------------------------
def update_gravity
# 如果重力开关关闭则重力失效
if start_can?
return
end
# 如果下落开关打开的话
if @g_key == true
if passable?(@real_x.round, @y, 2) and @y <= $game_map.height
@g_speed_down += 0.01
my = get_down_pos(@y)
dt = my - @y
if dt > @g_speed_down
@y += @g_speed_down
else
@y += dt
end
@real_y = @y
@isDown = true
else
@jump_number = 0
@real_y = @real_y.floor
@y = @real_y
@g_speed_down = 0 # 下降速度
=begin 若为正数:数值越大越快,修改建议在0到1之间(0为正常速度)
若为负数:则等上升完毕后,还会继续上升,修改数值越小越高,建议修改在0到-1之间(0为正常速度)
=end
@isDown = false
end
end
end
#--------------------------------------------------------------------------
# ● 取得上一个障碍点的
#--------------------------------------------------------------------------
def get_up_pos(sy)
my = sy.floor
while(true)
if passable?(@x, my, 8) == false
return my
else
my -= 1
end
end
end
#--------------------------------------------------------------------------
# ● 取得下一个障碍点的
#--------------------------------------------------------------------------
def get_down_pos(sy)
my = sy.floor
while(true)
if passable?(@x, my, 2) == false
return my
else
my += 1
end
end
end
#--------------------------------------------------------------------------
# ● 判定是否移动中
#--------------------------------------------------------------------------
def moving?
if start_can?
@real_x != @x
else
@real_x != @x || @real_y != @y
end
end
#--------------------------------------------------------------------------
# ● 径向移动
# d : 方向(2,4,6,8)
# turn_ok : 是否可以改变方向
#--------------------------------------------------------------------------
def move_straight(d, turn_ok = true)
if start_can?
if d == 2 or d == 8
return
end
end
@move_succeed = passable?(@x, @y, d)
if @move_succeed
set_direction(d)
@x = $game_map.round_x_with_direction(@x, d)
@y = $game_map.round_y_with_direction(@y, d)
@real_x = $game_map.x_with_direction(@x, reverse_dir(d))
@real_y = $game_map.y_with_direction(@y, reverse_dir(d))
increase_steps
elsif turn_ok
set_direction(d)
check_event_trigger_touch_front
end
end
end
#encoding:utf-8
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
# 地图画面
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
def update
super
if Input.trigger?(:C)
$game_player.jump_start
end
$game_map.update(true)
$game_player.update
$game_timer.update
@spriteset.update
update_scene if scene_change_ok?
end
end