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.

Non-Passable hud

Tdata

Sponsor

Here is what i want to have happen. I have a Picture hud that inhabits the left and top of my screen. I'm sick of the player being able to walk under the hud. What would i need to change to make the map scroll when it is say 92px from the edge of the top and left side?
 

Tdata

Sponsor

How would i go about doing that?

Also whilke we are are at it, why doesn't this statement compute?
Code:
    if $game_party.gold  <= 20
      @hud_Test.bitmap = RPG::Cache.picture("gold1.png")
    elsif $game_party.gold >= 21 and <= 40
      @hud_Test.bitmap = RPG::Cache.picture("gold2.png")
    elsif $game_party.gold >=41 and <= 60
      @hud_Test.bitmap = RPG::Cache.picture("gold3.png")
    elsif $game_party.gold >=61 and <=80
      @hud_Test.bitmap = RPG::Cache.picture("gold4.png")
    else
      @hud_Test.bitmap = RPG::Cache.picture("gold5.png")
    end
 
1: In the update method of the HUD window, check if $game_player.x and $game_player.y is between self.x, self.y, self.width, and self.height. After which, decrease the contents_opactiy like so:
Code:
self.contents_opacity -= 5 if self.contents_opacity > 160 # Decrease
self.contents_opacity += 5 if self.contents_opacity < 255 # Increase

2: Because you can't have a logic followed directly by an operator. You need to have the variale again, like so:
Code:
    elsif $game_party.gold  <= 21 and $game_party.gold  <= 40
    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