Mundo Maker
¡Bienvenid@ a Mundo Maker!

¿Quieres aprender todo sobre el RPG Maker?



Regístrate y forma parte de Mundo Maker.
Conectarse

Recuperar mi contraseña

Temas importantes
----------------------------------------
Páginas con recursos RPG Maker
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
Afiliados
Estadísticas
Tenemos 4069 miembros registrados.
El último usuario registrado es Fenix157.

Nuestros miembros han publicado un total de 84121 mensajes en 11982 argumentos.

Cambiar imagen barra de vida

Ver el tema anterior Ver el tema siguiente Ir abajo

Cambiar imagen barra de vida

Mensaje por axl1235 el 2013-03-02, 13:47

Bueno gente, eh estado revisando tutoriales, pero no lo logro hacer :S
Queria pedir a alguien ayuda, supongo que no es muy dificil.

Primero les paso el script Scene_Map 2

Spoiler:
Código:
#==============================================================================
# * Scene_Map
#------------------------------------------------------------------------------
#  It is the class which processes the map picture.
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # - Draw HP Window
  #--------------------------------------------------------------------------
  def draw_hp
    # Draw HP Window
    @hp_window = Window_Sta.new
    @hp_window.back_opacity = 160
    @viewport_bor= Viewport.new(91, 26, 55, 32)
    @viewport_bor.z = 220
    @hp_slide = Plane.new(@viewport_bor)
    @hp_slide.bitmap = RPG::Cache.title("life")
    @hp_bor = Sprite.new(@viewport_bor)
    @hp_bor.bitmap = RPG::Cache.title("life_bor")
    @hp_bor.z = 240
    if $game_switches[1] == false
      @hp_slide.visible = false
      @hp_bor.visible = false
    end
  end
  #--------------------------------------------------------------------------
  # - Dispose HP Window
  #--------------------------------------------------------------------------
  def dispose_hp
    @hp_window.dispose
    @viewport_bor.dispose
    @hp_slide.dispose
    @hp_bor.dispose
  end
  #--------------------------------------------------------------------------
  # - Refresh Windows
  #--------------------------------------------------------------------------
  def re_window
    @hp_window.refresh
  end
  #--------------------------------------------------------------------------
  # - Refresh Windows
  #--------------------------------------------------------------------------
  def re_window_2
    @hp_window.visible = true
    @hp_slide.visible = true
    @hp_bor.visible = true
  end
end

Scene_Menu 1
Spoiler:
Código:
#==============================================================================
# * Scene_Menu
#------------------------------------------------------------------------------
#  It is the class which processes the menu screen.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # - Object initialization
  #--------------------------------------------------------------------------
  def initialize(mode_menu=1,file=0)
    @mode_menu = mode_menu
    @file_index = file
  end
  #--------------------------------------------------------------------------
  # - Main processing
  #--------------------------------------------------------------------------
  def main
    # Drawing up the command window
    @s1 = ""
    @s2 = "check"
    @s3 = "combine"
    @s4 = "Yes"
    @s5 = "No"
    @command_window = Window_Command.new(160, [@s1, @s2, @s3])
    @command_window.x = 244
    @command_window.y = 128
    @command_window.z = 240
    @command_window.active = false
    @command_window.visible = false
    @mini_command_window = Window_Command.new(160, [""])
    @mini_command_window.active = false
    @mini_command_window.visible = false
    #-----------------------------------------------
    @menu_command_window = Window_Menu.new
    @menu_command_window.index = @mode_menu
    if @mode_menu != 1 and $game_variables[1] == 0
      @menu_command_window.active = false
    else
      @menu_command_window.active = true
    end
    @file_window = Window_File_List.new
    @file_window.index = @file_index
    if @mode_menu != 0  or $game_variables[1] != 0
      @file_window.active = false
      @file_window.visible = false
    end
    # Drawing up the help window and the item window
    @help_window = Window_Item_Help.new
    @help_check_window = Window_Item_Help.new
    @help_check_window.visible = false
    @item_window = Window_Item.new
    @item_window.active = false
    @item_window.index = -1
    @item_com_window = Window_Item_com.new
    @item_com_window.opacity = 0
    @item_com_window.visible = false
    @head_window = Window_Base.new(404, 424, 236, 56)
    @sixe_window = Window_Base.new(0, 128, 404, 224)
    @Wea_SP_windows = Windows_Wea_SP.new
    # Drawing up the Item Image
    @face_windows = Window_Face.new
    @data_windows = Window_Hp.new
    @viewport= Viewport.new(148, 48, 120, 64)
    @viewport.z = 220
    @hp_slide = Plane.new(@viewport)
    @hp_slide.bitmap = RPG::Cache.title("menu")
    @hp_bor = Sprite.new
    @hp_bor.bitmap = RPG::Cache.title("menu_2")
    @hp_bor.x = 148
    @hp_bor.y = 48
    @hp_bor.z = 240
    @sprite = Sprite.new
    @sprite.visible = false
    # Help window association
    @item_window.help_window = @help_window
    # Transition execution
    Graphics.transition
    # Main loop
    loop do
      # Renewing the game picture
      Graphics.update
      # Updating the information of input
      Input.update
      # Frame renewal
      update
      # When the picture changes, discontinuing the loop
      if $scene != self
        break
      end
    end
    # Transition preparation
    Graphics.freeze
    # Releasing the window
    @help_window.dispose
    @help_check_window.dispose
    @item_window.dispose
    @item_com_window.dispose
    @command_window.dispose
    @sprite.dispose
    @mini_command_window.dispose
    @menu_command_window.dispose
    @face_windows.dispose
    @file_window.dispose
    @data_windows.dispose
    @viewport.dispose
    @hp_slide.dispose
    @hp_bor.dispose
    @head_window.dispose
    @sixe_window.dispose
    @Wea_SP_windows.dispose
  end
  #--------------------------------------------------------------------------
  # - Frame renewal
  #--------------------------------------------------------------------------
  def update
    # Renewing the window
    @help_window.update
    @help_check_window.update
    @item_window.update
    @item_com_window.update
    @command_window.update
    @sprite.update
    @mini_command_window.update
    @menu_command_window.update
    @face_windows.update
    @file_window.update
    @data_windows.update
    @viewport.update
    @hp_slide.ox += 2
    @hp_bor.update
    @head_window.update
    @sixe_window.update
    @Wea_SP_windows.update
    # When the item window is active,: Update_menu is called
    if @menu_command_window.active
      update_menu
      return
    end
    # When the item window is active,: Update_menu is called
    if @file_window.active
      update_file
      return
    end
    # When the command window is active,: Update_command is called
    if @command_window.active
      update_command
      return
    end
    # When the item window is active,: Update_item is called
    if @item_window.active
      update_item
      return
    end
    # When the item window is active,: Update_item is called
    if @mini_command_window.active
      update_mini_command
      return
    end
    # When the item window is active,: Update_item is called
    if @item_com_window.active
      update_item_com
      return
    end
  end
  #--------------------------------------------------------------------------
  # - When frame renewal (the item window is active)
  #--------------------------------------------------------------------------
  def update_item
    # The B when button is pushed
    if Input.trigger?(Input::B)
      # Performing cancellation SE
      $game_system.se_play($data_system.cancel_se)
      # Change to menu screen
      @item_window.active = false
      @item_window.index = -1
      @menu_command_window.active = true
      return
    end
    # When C button is pushed
    if Input.trigger?(Input::C)
      # Acquiring the data which presently is selected in the item window
      @item = @item_window.item
      if @item != nil
        if @item.is_a?(RPG::Item) or @item.is_a?(RPG::Armor)
          # Performing decision SE
          $game_system.se_play($data_system.decision_se)
          @s1 = "use"
          @command_window = Window_Command.new(160, [@s1, @s2, @s3])
          @command_window.x = 244
          @command_window.y = 128
          @command_window.z = 240
        elsif @item.is_a?(RPG::Weapon)
          # Performing decision SE
          $game_system.se_play($data_system.decision_se)
          @s1 = "equip"
          @command_window = Window_Command.new(160, [@s1, @s2, @s3])
          @command_window.x = 244
          @command_window.y = 128
          @command_window.z = 240
        end
        @item_window.active = false
        @command_window.active = true
        @command_window.visible = true
      end
      return
    end
  end
end
La idea es hacer, que a medida que el monstruo te ataque cambiar la barra de vida. Algo asi seria la barra llena
Spoiler:
Supongan que me ataca un monstruo, me gustaría que cambie a esto

Spoiler:


No se si me hago entender xD
avatar
axl1235
Novato
Novato

0/3

Créditos 76

Gracias : 2

http://www.taringa.net/axl1235

Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba


Permisos de este foro:
No puedes responder a temas en este foro.