From: Matthew Moss Date: 2008-11-04T03:12:57+09:00 Subject: Re: Text Based RPG in Ruby > > class Grunty < Enemy > def initialize(hp,attack, defense, weapon) > super(hp, attack, defense) > @weapon = "AK47" > @hp =100 > if Grunto.hp == 0 > puts "Grunty is dead!" > else > puts "Grunty is wounded but can still fight!" > end > randy = rand(100) > health = Grunto.hp - randy > puts "Grunty's hp is #{Health}" > end First, did you mean Grunto.hp or Grunty.hp? Second, even if you meant Grunty.hp, I do not think that means what you think that means. Third, if you meant @hp instead of Grunty.hp, then why even bother checking if == 0 since you just assigned 100 to it?