Pagina's

Tuesday 23 July 2019

G.O.A.T. of goats

Ha! Did you get the pun? The goat. Greatest Of All Time. I just needed to make that joke. It's not Lionel Messi or Cristiano Ronaldo or even Kanye West or whatever he needs to be called nowadays.  The goat is either Peter Sagan or my goat objects.

Last post I told you that I wanted my goat script to have an overhaul and I did do that this morning while my wife was still asleep. I made a new class, an Animal class. Animals are objects that start as some sort of unit and turn into a resource once they die. Probably, I'll turn trees into animals too, because you first need to cut them before they bring resources. Biologists, don't worry, because I know that trees are plants and not animals.

Anyway goats are now animals.  It's official.  They run around randomly,  being just a bit slower than the humans. I have a piece of code that I'll delete later. When I press M, all goats get 10 damage. Biologists should know that goats has 50 hit points, so after 5 times,  it's gone.

Once the goat has gone where we can't follow, it's replaced by a  "dead goat" object, just like we all will have that happen to us.  A dead goat is a resources for food.

Workers will be able to gather that, but be quick,  because I added a rot timer to resources.  A rock will not quickly deplete on its own, but the weather is great here, so animals will. Every 5 seconds,  one piece of food will vanish from the dead goat.

Well, that works. I'm now sitting in the back yard again, soaking up the sun. I'll be working on the game again soon, probably turning trees into animals. I think I'll have the combat system soon.

No comments:

Post a Comment