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.

No More heroes scripts (only 1 left)

Twirly

Sponsor

For my new Project No More Heroes VX (first game and fangame yay!)
I want to have 2 scripts.
1)
This one is a Mod for The crissaegrim ABS. (newest version)
I want a Hud which only shows the Health Points and instead of a health bar,
i want to have that pixel heart like in the normal No More Heroes (BTW. it's a really good game. Buy it if you have a wii)
heres a screen of it:
http://feminocracy.files.wordpress.com/2008/04/no-more-heroes-20070706093109539_640w.jpg[/img]
This one is already made by poccil.
For the menu use the same heart like poccil.
The second One is a new Menu.
It should be like this:
http://img168.imageshack.us/img168/610/nmhvxmenual5.png[/img]
Health Heart should show the heart like in the script above.
Weapon icon should show the icon of the Weapon you have equipped and (forgot to add it)
the name of the Weapon should stay below.
I guess cash is clear and playtime too.
And the Name and rank is the last.
It just shows the Hero name and his rank. (again ranking fights but not same characters)
The ranks should be like this.
If the variable 1 (or whatever) in the database is 5 you rank is Number 5 if it is 4 you're Rank 4 (you know what I mean)
You aren't able to do anything in this Menu. It's meant to be a pause menu
and menu to view you current stats.

I really appreciate your help because those are important things for the game i can't do by myself.
EDIT:
Of course i will credit you!
 

poccil

Sponsor

Here's the script I wrote that draws the health heart on the top left corner.  Put it after all other scripts in the Materials section (or, if necessary, before all other scripts there).

Code:
class HealthHeart < Sprite
 def initialize(actor,viewport)
  super(viewport)
  @bitmap=Bitmap.new(96,96)
  @actor=actor
  self.bitmap=@bitmap
  refresh
  @currentHP=@actor.hp
 end
 def dispose
  @bitmap.dispose
  super
 end
 def update
   super
   if @actor && @currentHP!=@actor.hp
     @currentHP=@actor.hp
     refresh
   end
 end
 def refresh
  heartPieces=[
   0,1,1,0,1,1,0,
   1,1,1,1,1,1,1, # 11
   1,1,1,1,1,1,1, # 18
   0,1,1,1,1,1,0, # 23
   0,0,1,1,1,0,0, # 26
   0,0,0,1,0,0,0  # 27
  ]
  @bitmap.clear
  return if !@actor
  heartPieceSize=(bitmap.width/7)*85/100
  heartPieceRoom=(bitmap.width/7)
  lostHealth=(@actor.maxhp-@actor.hp)*27/@actor.maxhp
  pieceIndex=0
  for i in 0...heartPieces.length
   piece=heartPieces[i]
   next if piece==0
   x=(i%7)*heartPieceRoom
   y=(i/7)*heartPieceRoom
   @bitmap.fill_rect(x+1,y+1,heartPieceSize,heartPieceSize,
      Color.new(0,0,0))
   if pieceIndex<lostHealth
    # Dark red
    @bitmap.fill_rect(x,y,heartPieceSize,heartPieceSize,
      Color.new(80,0,0))
   else
    # Bright red
    @bitmap.fill_rect(x,y,heartPieceSize,heartPieceSize,
      Color.new(255,0,0))
   end
   pieceIndex+=1
  end
 end
end

###################

class Spriteset_Map
  if !defined?(petero_heart_Spriteset_Map_create_pictures)
    alias petero_heart_Spriteset_Map_create_pictures create_pictures
    alias petero_heart_Spriteset_Map_update_pictures update_pictures
    alias petero_heart_Spriteset_Map_dispose_pictures dispose_pictures
  end
  def create_pictures
    petero_heart_Spriteset_Map_create_pictures
    @heart=HealthHeart.new($game_actors[1],@viewport2)
    @heart.x=16
    @heart.y=16
  end
  def update_pictures
    petero_heart_Spriteset_Map_update_pictures
    @heart.update
  end
  def dispose_pictures
    petero_heart_Spriteset_Map_dispose_pictures
    @heart.dispose
  end
end
 

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