From: "Jan E." Date: 2012-10-03T02:34:22+09:00 Subject: Re: still learning by doing - connecting rooms in a game Sebastjan H. wrote in post #1078385: > I tried this and I removed the attr_accessor line and had the methods > defined, but then the code doesn't work: What do you mean by "doesn't work"? The class does exactly what it should: zombie = Zombie.new 'some_name', 'some_hp', 'some_paces', 'some_target' p zombie puts zombie.name Note that you do *not* have writer methods, so you cannot do something like zombie.name = 'newname' Anyway, the right way to do this is to use attr_accessor. -- Posted via http://www.ruby-forum.com/.