Respawn dari Game Over




Fitur

  • Bikin player bisa balik ke tempat terakhir save kalau gameover



Screenshots






Demo

Ga perlu lah


Scripts

Code:

#==============================================================================
# ** Respawn dari Game Over
# Dibuat oleh LiTTleDRAgo
#------------------------------------------------------------------------------
class Game_System
  attr_accessor :respawn_map_id         
  attr_accessor :respawn_player_x       
  attr_accessor :respawn_player_y       
  alias_method :drago_init, :initialize
 
  def initialize
    drago_init
    @respawn_map_id = $data_system.start_map_id
    @respawn_player_x = $data_system.start_x
    @respawn_player_y = $data_system.start_y
  end
end

class Scene_Gameover
  alias_method :drago_main, :main

  def main
    @transferring = false
    s1 = "Kembali ke Save Point"
    s2 = "Kembali ke Title"
    s3 = "Keluar dari Game"
    @choice_window = Window_Command.new(392, [s1, s2, s3])
    @choice_window.back_opacity = 160
    @choice_window.x = 320 - @choice_window.width / 2
    @choice_window.y = 308
    drago_main
  end

  def update
    @choice_window.update
    if Input.trigger?(Input::C)
      case @choice_window.index
      when 0 
        command_respawn
      when 1 
        command_title
      when 2 
        command_shutdown
      end
    end
  end

  def command_respawn
    respawn_map_id = $game_system.respawn_map_id
    respawn_map_x = $game_system.respawn_player_x
    respawn_map_y = $game_system.respawn_player_y
    $game_system.se_play($data_system.decision_se)
    @choice_window.dispose
    Audio.me_stop
    for actor in $game_party.actors
      actor.hp = 1
      @exp = actor.exp
      actor.exp = (@exp - 10000)
      actor.exp = 0 if actor.exp < 0
    end
    $game_map.setup(respawn_map_id)
    $game_player.moveto(respawn_map_x, respawn_map_y)
    $game_player.refresh
    $game_map.autoplay
    $game_map.update
    $scene = Scene_Map.new
  end

  def command_title
    $game_system.se_play($data_system.decision_se)
    Audio.me_fade(800)
    @choice_window.dispose
    $scene = Scene_Title.new
  end

  def command_shutdown
    $game_system.se_play($data_system.decision_se)
    Audio.me_fade(800)
    $scene = nil
  end
end

class Scene_Save < Scene_File
  alias_method :new_decision, :on_decision

  def on_decision(filename)
    $game_system.respawn_map_id = $game_map.map_id
    $game_system.respawn_player_x = $game_player.x
    $game_system.respawn_player_y = $game_player.y
  new_decision(filename)
  end
end




Cukup taruh diatas main

Penulis : Irgi Kusuma ~ Sebuah blog yang menyediakan berbagai macam informasi

Artikel Respawn dari Game Over ini dipublish oleh Irgi Kusuma pada hari Minggu, 26 Februari 2012. Semoga artikel ini dapat bermanfaat.Terimakasih atas kunjungan Anda silahkan tinggalkan komentar.sudah ada 0 komentar: di postingan Respawn dari Game Over
 

0 komentar:

Posting Komentar