Just some random questions

manam
20 Oct 2016, 19:49

So... just a question here, if I made an object named Zombie, gave it a attribute Health, then created a Attack verb that lowered Health , would that work?


Niekitty
20 Oct 2016, 21:48

Actually, yes it would.

There are a few ways to handle everything involved in combat, but that would be the most direct way of handling such a situation. As far as handling the zombie being defeated, you could add a section AFTER doing damage that checks to see If Zombie.Health < 1
Mister Zombie attacking back gets more complicated. Who attacks first, how does it monitor when attacks occur, etc. It makes for a big pile of code, but as far as the attack itself goes, you pretty much nailed it. :)