TheJP / GreenGameJam2018

2D Side View Base Defense Game
0 stars 0 forks source link

Attacks of monsters should cost them health #9

Open EdithBirrer1 opened 6 years ago

EdithBirrer1 commented 6 years ago

When implementing the meteor "monsters" (see branch feature-meteors, EdithScene), I noticed that the whole monster implementation focuses on ground-crawling monsters (path-finding etc.). By introducing a method "CanOnlyFall", I have tweaked the monster spawning and movement such that meteors become possible. The whole thing is far from finished (no collision handling, no sound, etc.), but works surprisingly well: meteors fly straight to a random oxygen station and destroy it. But after that, then they go on and attach the next oxygen station... We need either a trigger that does something on impact of a monster (sounds artificial to me) or a way of destroying the meteor (or monster in general) after an attack. So I propose to have an additional variable "AttackCost" in MonsterAttributes which gives the cost of an attack to the monster (like "attacking tires them out" - a monster cannot attack eternally). For meteors, this variable would be high enough to destroy the meteor after only one attack. (For the visual explosion effect on destroying the meteor see sparate issue).