RedFood an object with energy
Inherits from: RedObject
instance methods:
eat(amount)
takes away energy from this object. the default is 1.
returns how much energy was taken away.
energy can not go below 0 so if there is 6 left and 10 is taken, this method returns 4.
instance variables:
<>energy
scalar. default is 1000
a= RedWorld.new
b= RedFood(a)
a.objects
b.dump
b.eat(10)
b.energy //should now be 990
//see examples folder