Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 XRXS' Platformer
#1
Script by XRXS, posted by PK8.

Here's the code. Put it above main. It turns your game into a platformer. Think of Super Mario.

What's pretty cool about the script is that it allows you, the maker to decide which maps you want to have the platformer script enabled and disabled.

Press UP to jump. If you do not want UP to be the jump button then you can change UP to any button you want. (A, B, C, X, Y, Z, UP, LEFT, DOWN, RIGHT)
Code:
if Input.trigger?(Input::UP) and

This is the script.
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 = [3, 100]
#
# ?uŽÃŽ‚ß?~‰Âº?v
#
ENABLE_SLIDE_DESCENT = true
#
# ŒÃ¼‚«ƒWƒƒƒ“ƒv(true : ŒÃ¼‚¢‚Ä‚¢‚é•Ã»ŒÃ¼‚ÖƒWƒƒƒ“ƒv?B
# false : ƒL?[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚é•Ã»ŒÃ¼‚ÖƒWƒƒƒ“ƒv?B)
#
JUMP_AS_KEY = false
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 2
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
$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 = 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
Reply }
#2
I'm surprised no one has commented on this nifty lil' script!

thank you PK8, you are doing a great service here BTW~

g/A\/\/\|=|F/A\(C|=
Reply }
#3
This looks good!
Reply }
#4
This isn't mine, it's XRXS' script. :P
Reply }
#5
hey, glad to see this script in here!

Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   GPLAT Pixel Platformer Revised DerVVulfman 0 4,074 10-02-2014, 04:14 AM
Last Post: DerVVulfman
   ProjectMeLT XRXS - 5-6 Character Menu JackMonty 0 5,038 04-16-2013, 02:41 PM
Last Post: JackMonty
   XRXS No38: Element Limitation/Correction Helel 1 6,087 12-11-2009, 12:13 AM
Last Post: DerVVulfman
   XRXS No114: Manage Battle Speed Helel 0 5,578 12-07-2009, 09:18 AM
Last Post: Helel
   XRXS's Full-View Battleback & Movable Camera XRXS 0 5,268 06-10-2009, 03:30 AM
Last Post: XRXS



Users browsing this thread: