WASD移动,直接放在main上面即可,没有做过多的测试,不确定会不会在某些情况下出现BUG
class Game_Player def move_by_input return if !movable? || $game_map.interpreter.running? move_straight(Input.move_sym) if Input.move_sym > 0 end end class << Input @@move_sym = 0 def move_sym @@move_sym end alias mfupdate update def update mfupdate if press?(:R) || press?(:X) || press?(:Y) || press?(:Z) @@move_sym = 8 if press?(:R) @@move_sym = 4 if press?(:X) @@move_sym = 2 if press?(:Y) @@move_sym = 6 if press?(:Z) else @@move_sym = 0 end end end
class Game_Player
def move_by_input
return if !movable? || $game_map.interpreter.running?
move_straight(Input.move_sym) if Input.move_sym > 0
end
end
class << Input
@@move_sym = 0
def move_sym
@@move_sym
end
alias mfupdate update
def update
mfupdate
if press?(:R) || press?(:X) || press?(:Y) || press?(:Z)
@@move_sym = 8 if press?(:R)
@@move_sym = 4 if press?(:X)
@@move_sym = 2 if press?(:Y)
@@move_sym = 6 if press?(:Z)
else
@@move_sym = 0
end
end
end
|