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.

HBGames

Hi there everyone! :D

I'm working in a CBS and i want to show the names of the enemies in a little window
Actually if you are fighting to an slime, other slime, and a zombie for example... the window show this:

Slime
Slime
Zombie

But i want this:

Slime x2
Zombie

I know you can get the name with "enemy.name" but i need to compare that name with all of $game_troop.enemies
Sorry for my poor english

This is the part of the code:
Code:
  def refresh

    self.contents.clear

    self.contents.font.size = 24

    y = 60

    for enemy in $game_troop.enemies

      next if enemy.dead?

      self.contents.font.color = Color.new(0,0,0,192)

      self.contents.draw_text(-24, y+2, 192, 18, enemy.name, 2)

      y += 18

    end

  end

end


Thanks :grin:

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