deadcell Trouvère Follet
Nombre de messages : 625 Age : 35 Niveau Rpg Maker : Excellent Niveau Jeux Préférés : Final Fantasy, Resident evil... Date d'inscription : 21/03/2007
| Sujet: Faire un jeu plateforme Lun 02 Juil 2007, 17:17 | |
| Voilà un script qui vas vous permettre de faire un jeu de plate forme type Mario Bros ! - Auteur : Inconnu - Screen : - Installation : Ajoutex un nouveau script au-dessus de Main et nommé le "plateforme" collez ce code: - Code:
-
# ▼▲▼ XRXS50. Action-Maps XC. ▼▲▼ built 033010 # by 桜雅 在土
#============================================================================== # □ カスタマイズポイント #============================================================================== class XRXS50 # # Action-Maps を稼動させるマップIDの配列 # ENABLE_FULL_ACTY_MAPS = [1, 2] # # 「斜め降下」 # ENABLE_SLIDE_DESCENT = true # # 向きジャンプ(true : 向いている方向へジャンプ。 # false : キーが押されている方向へジャンプ。) # JUMP_AS_KEY = false end #============================================================================== # ■ Game_Player #============================================================================== class Game_Player < Game_Character #-------------------------------------------------------------------------- # ○ 公開インスタンス変数 #-------------------------------------------------------------------------- # 既存 attr_writer :direction_fix attr_accessor :walk_anime # 新規 attr_accessor :now_jumps attr_writer :xrxs50_direction_sidefix #-------------------------------------------------------------------------- # ○ 最大ジャンプ回数 #-------------------------------------------------------------------------- def max_jumps return 1 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_right turn_right def turn_right if @xrxs50_direction_sidefix @direction = 6 else xrxs50_turn_right end end end #============================================================================== # ■ Scene_Map #============================================================================== class Scene_Map #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- alias xrxs50_main main def main # チェック xrxs50_enable_check # 呼び戻す xrxs50_main end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias xrxs50_update update def update # 呼び戻す xrxs50_update # フレーム更新 (座標系更新) if @xrxs50_enable update_coordinates end end #-------------------------------------------------------------------------- # ○ フレーム更新 (座標系更新) #-------------------------------------------------------------------------- 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::X) 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 #-------------------------------------------------------------------------- # ● プレイヤーの場所移動 #-------------------------------------------------------------------------- alias xrxs50_transfer_player transfer_player def transfer_player # 呼び戻す xrxs50_transfer_player # チェック 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 | |
|
Erevan Acrobate
Nombre de messages : 104 Age : 30 Projet(s) en cours : Erevan Niveau Rpg Maker : 1/20 Jeux Préférés : Erevan ^^ Date d'inscription : 29/07/2007
| Sujet: Re: Faire un jeu plateforme Mer 29 Aoû 2007, 18:56 | |
| manque pas quelque chose la ???? j'ai pas tout suivit ??? coment on gere les tiltest apres ???
[edit] j'ai tester c'est pas mal mais comment on peut faire pour le faire sauter haut ??? | |
|