Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Can someone fix the jump height in this script for me?

It only jumps up 1 block making it impossible to jump onto anything above you. so I think I need it to be 2 blocks up that it can jump.

thnx.

# ?¥?£?¥ XRXS50. Action-Maps XC. ?¥?£?¥ built 033010
# by ?÷‰Ã« ?Ý“y
#==============================================================================
# ? ƒJƒXƒ^ƒ}ƒCƒYƒ|ƒCƒ“ƒg
#==============================================================================
class XRXS50
#
# Action-Maps ‚ð‰Ã’“®‚³‚¹‚éƒ}ƒbƒvID‚ÃŒ”z—ñ
#
ENABLE_FULL_ACTY_MAPS = [1, 4, 2, 22, 59]
#
# ?uŽÃŽ‚ß?~‰Âº?v
#
ENABLE_SLIDE_DESCENT = true
#
# ŒÃ¼‚«ƒWƒƒƒ“ƒv(true : ŒÃ¼‚¢‚Ä‚¢‚é•Ã»ŒÃ¼‚ÖƒWƒƒƒ“ƒv?B
# false : ƒL?[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚é•Ã»ŒÃ¼‚ÖƒWƒƒƒ“ƒv?B)
#
JUMP_AS_KEY = true
end
#==============================================================================
# ?¡ Game_Player
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# ?› ŒÃ¶ŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ã?”
#--------------------------------------------------------------------------
# ŠÃ¹‘¶
attr_writer :direction_fix
attr_accessor :walk_anime
# ?V‹K
attr_accessor :now_jumps
attr_writer :xrxs50_direction_sidefix
#--------------------------------------------------------------------------
# ?› ?Ã…‘Ã¥ƒWƒƒƒ“ƒv‰Ã±?”
#--------------------------------------------------------------------------
def max_jumps
return 5
end
#--------------------------------------------------------------------------
# ?œ ?¶‚ðŒÃ¼‚*
#--------------------------------------------------------------------------
alias xrxs50_turn_left turn_left
def turn_left
if @xrxs50_direction_sidefix
@direction = 4
else
xrxs50_turn_left
end
end
#--------------------------------------------------------------------------
# ?œ ‰E‚ðŒÃ¼‚*
#--------------------------------------------------------------------------
alias xrxs50_turn_right turn_right
def turn_right
if @xrxs50_direction_sidefix
@direction = 6
else
xrxs50_turn_right
end
end
end
#==============================================================================
# ?¡ Scene_Map
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# ?œ ƒ?ƒCƒ“?ˆ—?
#--------------------------------------------------------------------------
alias xrxs50_main main
def main
# ƒ`ƒFƒbƒN
xrxs50_enable_check
# ŒÃ„‚Ñ–ß‚·
xrxs50_main
end
#--------------------------------------------------------------------------
# ?œ ƒtƒŒ?[ƒ€?X?V
#--------------------------------------------------------------------------
alias xrxs50_update update
def update
# ŒÃ„‚Ñ–ß‚·
xrxs50_update
# ƒtƒŒ?[ƒ€?X?V (?À•WŒn?X?V)
if @xrxs50_enable
update_coordinates
end
end
#--------------------------------------------------------------------------
# ?› ƒtƒŒ?[ƒ€?X?V (?À•WŒn?X?V)
#--------------------------------------------------------------------------
def update_coordinates
if $game_player.passable?($game_player.x,$game_player.y,2)
unless $game_player.moving?
if XRXS50::ENABLE_SLIDE_DESCENT and
Input.press?(Input::RIGHT) and
$game_player.passable?($game_player.x,$game_player.y+1,6)
$game_player.move_lower_right
elsif XRXS50::ENABLE_SLIDE_DESCENT and
Input.press?(Input::LEFT) and
$game_player.passable?($game_player.x,$game_player.y+1,4)
$game_player.move_lower_left
else
$game_player.move_down
end
end
else
$game_player.move_down
$game_player.walk_anime = true unless $game_player.walk_anime
$game_player.now_jumps = 0
if Input.trigger?(Input::UP) and
Audio.se_play("Audio/SE/001-System01")
$game_player.now_jumps < $game_player.max_jumps
if XRXS50::JUMP_AS_KEY
direction = $game_player.direction == 4 ? -1 : 1
else
if Input.press?(Input::RIGHT)
direction = 1
elsif Input.press?(Input::LEFT)
direction = -1
else
direction = 0
end
end
$game_player.jump(direction, -2)
$game_player.now_jumps += 1
$game_player.walk_anime = false
end
end
end
#--------------------------------------------------------------------------
# ?œ ƒvƒŒƒCƒ„?[‚ÃŒ?ê?ŠˆÃš“®
#--------------------------------------------------------------------------
alias xrxs50_transfer_player transfer_player
def transfer_player
# ŒÃ„‚Ñ–ß‚·
xrxs50_transfer_player
# ƒ`ƒFƒbƒN
xrxs50_enable_check
end
#--------------------------------------------------------------------------
# ?› XRXS50 ‚ª‰Ã’“®‚·‚é‚©”»’è
#--------------------------------------------------------------------------
def xrxs50_enable_check
if XRXS50::ENABLE_FULL_ACTY_MAPS.include?($game_map.map_id)
$game_player.now_jumps = 2 if $game_player.now_jumps.nil?
@xrxs50_enable = true
$game_player.direction_fix = true
$game_player.xrxs50_direction_sidefix = true
else
@xrxs50_enable = false
$game_player.direction_fix = false
$game_player.xrxs50_direction_sidefix = false
end
end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top