Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

DeM0nFiRe's KH Health Bar

DeM0nFiRe's Kingdom Hearts Health Bar
Current Version: 1.0(07/16/07)

Preface/General Info:
This script shows the first party member's health on a curved bar, like in Kingdom hearts, not to hard to figure out.

How to Install: Insert this script above main. Then you must make pictures for the curved part of the bar at 61-100%. These pictures should be named "KH_x" where xx is the percent. the next version of the script will draw the curve for you, but I needed a version out now.

To Use: 1.Put "@healthbar = Sprite_KHBar.new" right below
"@message_window = Window_Message.new" in Scene_Map
2.Put "@healthbar.update" right below "loop do" in Scene_Map
3.Play!
NOTE!: To use this script non-commercially, you MUST credit DeM0nFiRe, To use in a commercial project, please conatact DeM0nFiRe

Code:
################################################################################
#Title: Kingdom Hearts Health Bar V1.0 (07/16/07)###############################
################################################################################
#Scripter: DeM0nFiRe############################################################
################################################################################
#To Use: 1.Put "@healthbar = Sprite_KHBar.new" right below "@message_window =###
#########  Window_Message.new" in Scene_Map#####################################
#########2.Put "@healthbar.update" right below "loop do" in Scene_Map###########
#########3.Play!################################################################
################################################################################
#To Install: Insert this script above main. Then you must make pictures for the#
#curved part of the bar at 61-100%. These pictures should be named "KH_x" where#
#where xx is the percent. the next version of the script will draw the curve####
#for you, but I needed a version out now.#######################################
################################################################################
#NOTE!: To use this script non-commercially, you MUST credit DeM0nFiRe, To use##
#in a commercial project, please conatact DeM0nFiRe############################# 
################################################################################
class Sprite_KHBar < Sprite
#--------------------
  def initialize
    super
    self.bitmap = Bitmap.new(200, 200)
    self.x = 640 - self.bitmap.width
    self.y = 200
    self.z = 500
    @health = $game_party.actors[0].hp * 100
    @maxhealth = $game_party.actors[0].maxhp
    @frame = (@health / @maxhealth)
    update
  end
#--------------------
  def dispose
    if self.bitmap != nil
      self.bitmap.dispose
    end
    super
  end
#--------------------
  def update
    color = Color.new(36, 185, 63)
    @health = $game_party.actors[0].hp * 100
    @maxhealth = $game_party.actors[0].maxhp
    if @frame != (@health / @maxhealth)
      self.bitmap.clear
      @frame =  * (@health / @maxhealth)      
    end
    case @frame.round
    when 0
    when 1
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 2
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 3
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 4
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 5
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 6
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 7
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 8
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 9
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 10
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 11
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 12
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 13
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 14
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 15
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 16
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 17
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 18
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 19
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 20
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 21
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 22
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 23
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 24
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 25
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 26
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 27
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 28
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 29
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 30
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 31
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 32
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 33
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 34
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 35
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 36
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 37
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 38
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 39
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 40
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 41
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 42
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 43
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 44
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 45
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 46
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 47
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 48
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 49
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 50
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 51
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 52
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 53
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 54
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 55
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 56
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 57
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 58
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 59
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 60
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 61
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_61")
    when 62
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_62")
    when 63
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_63")
    when 64
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_64")
    when 65
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_65")
    when 66
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_66")
    when 67
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_67")
    when 68
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_68")
    when 69
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_69")
    when 70
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_70")
    when 71
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_71")
    when 72
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_72")
    when 73
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_73")
    when 74
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_74")
    when 75
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_75")
    when 76
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_76")
    when 77
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_77")
    when 78
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_78")
    when 79
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_79")
    when 80
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_80")
    when 81
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_81")
    when 82
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_82")
    when 83
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_83")
    when 84
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_84")
    when 85
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_85")
    when 86
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_86")
    when 87
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_87")
    when 88
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_88")
    when 89
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_89")
    when 90
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_90")
    when 91
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_91")
    when 92
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_92")
    when 93
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_93")
    when 94
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_94")
    when 95
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_95")
    when 96
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_96")
    when 97
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_97")
    when 98
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_98")
    when 99
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_99")
    when 100
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_99")
    end
  end
end

Questions and feedback are welcome.
 
umm yeah I didn't like the header :P

1.)
Please tell me you didn't type all of this out :-/

Code:
    when 1
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 2
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 3
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 4
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 5
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 6
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 7
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 8
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 9
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 10
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 11
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 12
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 13
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 14
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 15
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 16
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 17
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 18
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 19
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 20
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 21
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 22
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 23
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 24
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 25
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 26
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 27
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 28
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 29
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 30
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 31
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 32
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 33
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 34
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 35
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 36
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 37
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 38
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 39
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 40
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 41
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 42
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 43
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 44
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 45
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 46
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 47
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 48
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 49
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 50
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 51
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 52
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 53
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 54
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 55
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 56
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 57
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 58
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 59
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
    when 60
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
you could have just used

Code:
when 1..60
  self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
Next
Code:
    when 61
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_61")
    when 62
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_62")
    when 63
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_63")
    when 64
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_64")
    when 65
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_65")
    when 66
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_66")
    when 67
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_67")
    when 68
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_68")
    when 69
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_69")
    when 70
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_70")
    when 71
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_71")
    when 72
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_72")
    when 73
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_73")
    when 74
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_74")
    when 75
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_75")
    when 76
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_76")
    when 77
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_77")
    when 78
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_78")
    when 79
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_79")
    when 80
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_80")
    when 81
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_81")
    when 82
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_82")
    when 83
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_83")
    when 84
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_84")
    when 85
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_85")
    when 86
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_86")
    when 87
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_87")
    when 88
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_88")
    when 89
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_89")
    when 90
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_90")
    when 91
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_91")
    when 92
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_92")
    when 93
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_93")
    when 94
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_94")
    when 95
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_95")
    when 96
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_96")
    when 97
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_97")
    when 98
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_98")
    when 99
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      @curve.bitmap = RPG::Cache.picture("KH_99")
    when 100
      self.bitmap.fill_rect(0,170,120,10,color)
      @curve = Sprite.new
      [COLOR=Red]@curve.bitmap = RPG::Cache.picture("KH_99")[/COLOR]
could have been

Code:
  when 61..100
    self.bitmap.fill_rect(0,170,120,10,color)
    @curve = Sprite.new 
    @curve.bitmap = RPG::Cache.picture("KH_#{@frame}")

on another note what's with the code in read above????

2.)
ok next
Code:
[COLOR=Red]    when 0[/COLOR]
    when 1
      self.bitmap.fill_rect(0,170,@frame.round * 2,10,color)
If you aren't going to do anything with it then why have it there :p

3.)
well I do not agree with the way you coded your update method. the way you did it it will ALWAYS redraw/draw over the bar every frame since

Code:
    @health = $game_party.actors[0].hp * 100
    @maxhealth = $game_party.actors[0].maxhp
    if @frame != (@health / @maxhealth)
      self.bitmap.clear
      @frame =  * (@health / @maxhealth)      
    end
    #draw the bar code here
you don't have anything to skip the drawing code if the percentage is the same add an else cause to make it exit the method if @frame == @health / @maxhealth

4.)
I don't really think @health and @maxhealth should be declared as instance variables since you can just do this instead

Code:
@frame = $game_party.actors[0].hp * 100 / $game_party.actors[0].maxhp

Hehe other than that good job, but this can still benefit from refining.
 
Heh, actually all that stuff you mentioned, Trickster, kept me awake last night. Unfortunately, Sasuke needed this script fast so I kinda just made it work, not necessarily work well. I plan on fixing all of those rhings and adding some new features to it. I'll probably fix some of the bigger mistakes later on today.

Thanks for pointing those out.

1.)heh heh, no way, that was copy and paste. :D

2.)That was there because I was trying a few different ways to draw the bar, and some of them involved that "when 0". I never got around to deleting it in case I used it again.

3.)Actually, when I fix it I plan on doing it a little differently.

4.)Yeah true, but I was trying a few different things and I didn't have time to fix that either.

And Lastly: Yeah sorry about the ugly header, I haven't the slightest idea what I was doing.
 
I can make one in a day or so... if I don't forget... I'll make the script custimizable too.... My script is different from DemonFires but it's basically setup the same...
 

Taylor

Sponsor

It is encrypted. Encrypted is when you can't edit it in RMXP or get to the graphics files.
Why did you encrypt it when you didn't mean to sasuke89. :|
 
It works but i's not that KH....anyway I know what's encrypted....it's just I didn't get what he said. It doesn't have KH style because it has the Battle Dungeon style to it but it still has that face thingy. Anyway great script DemonFire....but I still don't know how to set the bars up....
 
It's supposed to... I made it that way because I could make the animation stay in that position for more than a frame... So I put a wait count count to make it stay for 10... So I made it lag on purpose.. lol... Thanks for posting... I nearly forgot about the script I'll post an Unencrypted one later today.


EIDT:::

http://www.megaupload.com/?d=Y5FFUBZS
 
What must i do to show 3 HUD?s ? ( from left to right at the Top of the Screen )

For a better example:

I have a HUD:
http://img366.imageshack.us/img366/4830 ... ienrh8.png[/IMG]

And these Curved Bar-Piece:
http://img476.imageshack.us/img476/5006/kh100xy7.png[/IMG]

(The White is Transparent)

You see, before the Curved Part, is a Rect Part free space... I want a HP-Bar there. If the Bar is full ( full is where the curve starts ), the curved part will be getting fuller ( if the HP % is below 69.. the curve is empty and the bar gets emptier ).

How can i make that?

If you can create me something, i send you the Cuvre-Pictures ( from 69 to 100 ).
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top