Save-Point
platform script problem - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: platform script problem (/thread-391.html)



platform script problem - mangamaniacs2064 - 04-03-2010

here is the platform script.
the script work i made a platform game with it..
the problem is that when i press up the player jump...
if there is an event (a bloc or something) the player hit it and then go down.
but if the player press up and left or right the player is going up pass the block..
it pass trough the block.. look at the script and please tell me how can i make the up left or up right like the up fonction (i mean not going trough the object)


platform script problem - Kristovski - 04-03-2010

I don't see the script..
Is it just me?


platform script problem - mangamaniacs2064 - 04-03-2010

sorry here is the script i forgot to copy it here...

Code:
# ?¥?£?¥ 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]
#
# ?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
#--------------------------------------------------------------------------

#--------------------------------------------------------------------------
alias xrxs50_turn_up turn_up
def turn_up
if @xrxs50_direction_sidefix
@direction = 8
else
xrxs50_turn_up
end
end
#--------------------------------------------------------------------------



#--------------------------------------------------------------------------
alias xrxs50_turn_down turn_down
def turn_down
if @xrxs50_direction_sidefix
@direction = 2
else
xrxs50_turn_down
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.walk_anime = true unless $game_player.walk_anime
$game_player.now_jumps = 0
if Input.trigger?(Input::UP) and
$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 = 6
elsif Input.press?(Input::LEFT)
direction = 4
else
direction = 8
end
end
$game_player.jump(direction, -3)
$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 = 0 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



platform script problem - PK8 - 04-03-2010

Moving this to RGSS Support as this isn't really a request.


platform script problem - mangamaniacs2064 - 04-04-2010

so now can someone help me modifying the script?
i want to be able to jump left or right side and then be able to go down when i hit a block instaed of going through read my first text please then help me