本帖最后由 soulsaga 于 2016-10-12 15:50 编辑
我已经找出问题所在了.
if not $ud_ok @jumpnow -= 10 if @jumpnow < 0 @character_name = "主角ACT12下落" @jumpnow = [@jumpnow, -JUMPMAX].max if not down1(((@x * 128 + @revise_x) / 128.0).round, ((@y * 128 + @revise_y) / 128.0).round, -@jumpnow, true) @jumpnow = 0 @twojump = 0 @character_name = "主角 行走 长袖"
if not $ud_ok
@jumpnow -= 10
if @jumpnow < 0
@character_name = "主角ACT12下落"
@jumpnow = [@jumpnow, -JUMPMAX].max
if not down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, -@jumpnow, true)
@jumpnow = 0
@twojump = 0
@character_name = "主角 行走 长袖"
注译了第4行和第10行就可以正常替换行走图了..那看来是因为这里强制替换了图像的原因跟事件的替换行走图起冲突了吧
最后改成这杽亲测能通过..
#-----------------------按跳跃----------------------------------------------- # A ボタンが押された場合 if Input.press?(Input::A) and not $ud_ok $game_switches[1] = true @twojump = 1 if @twojump == 0 and down1(((@x * 128 + @revise_x) / 128.0).round, ((@y * 128 + @revise_y) / 128.0).round, 5, true) if (not @apassed) and @twojump <= $airjump @apassed = true @jumpnow = JUMPMAX se_name = @twojump == 1 ? "ACT 跳02.wav" : "ACT 跳01.wav" Audio.se_play("Audio/SE/#{se_name}") @twojump += 1 else @jumpnow += 3 end else @apassed = false end #----------------------自由落体-------------------------------- if not $ud_ok and $game_switches[1] == true @jumpnow -= 10 if @jumpnow < 0 @character_name = "主角ACT12下落" @jumpnow = [@jumpnow, -JUMPMAX].max if not down1(((@x * 128 + @revise_x) / 128.0).round, ((@y * 128 + @revise_y) / 128.0).round, -@jumpnow, true) @jumpnow = 0 @twojump = 0 @character_name = "主角 行走 长袖" $game_switches[1] = false end elsif @jumpnow > 0 @character_name = @twojump == 1 ? "主角 ACT用跳跃" : "主角ACT11两段跳" @jumpnow = [@jumpnow, JUMPMAX].min if not up1(((@x * 128 + @revise_x) / 128.0).round, ((@y * 128 + @revise_y) / 128.0).round, @jumpnow, true) @jumpnow = 0 end end end
#-----------------------按跳跃-----------------------------------------------
# A ボタンが押された場合
if Input.press?(Input::A) and not $ud_ok
$game_switches[1] = true
@twojump = 1 if @twojump == 0 and down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, 5, true)
if (not @apassed) and @twojump <= $airjump
@apassed = true
@jumpnow = JUMPMAX
se_name = @twojump == 1 ? "ACT 跳02.wav" : "ACT 跳01.wav"
Audio.se_play("Audio/SE/#{se_name}")
@twojump += 1
else
@jumpnow += 3
end
else
@apassed = false
end
#----------------------自由落体--------------------------------
if not $ud_ok and $game_switches[1] == true
@jumpnow -= 10
if @jumpnow < 0
@character_name = "主角ACT12下落"
@jumpnow = [@jumpnow, -JUMPMAX].max
if not down1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, -@jumpnow, true)
@jumpnow = 0
@twojump = 0
@character_name = "主角 行走 长袖"
$game_switches[1] = false
end
elsif @jumpnow > 0
@character_name = @twojump == 1 ? "主角 ACT用跳跃" : "主角ACT11两段跳"
@jumpnow = [@jumpnow, JUMPMAX].min
if not up1(((@x * 128 + @revise_x) / 128.0).round,
((@y * 128 + @revise_y) / 128.0).round, @jumpnow, true)
@jumpnow = 0
end
end
end
主要是加了开关和判断..
另外开头这些设置
# ● 定数
#--------------------------------------------------------------------------
UP = 16 # 上方向の余裕(0 < UP < 63)
DOWN = -5 # 这个是垂直方向微调 下方向の余裕(0 < DOWN <63)
SIDE = 32 # 左右方向の余裕(0 < SIDE <63)
左右设成0的话..就不会陷入墙壁内了..
|