git repos / saland

commit 6605e011

Poul Sander · 2024-12-23 16:25
6605e011752a7619a8985b75cdaa4eccd6bc79c2 patch · browse files
parent d6e96c5185d138b928b11d10658f5ed50233cd00

Add a bee. Give bat and bee different amount of hit points

Changed files

M src/saland/GameRegion.cpp before
diff --git a/src/saland/GameRegion.cpp b/src/saland/GameRegion.cpp index 3da96b7..5f4b9ce 100644 --- a/src/saland/GameRegion.cpp +++ b/src/saland/GameRegion.cpp
@@ -43,6 +43,9 @@ void GameRegion::SpawnMonster(const MonsterDef& def, float destX, float destY) {
bat.get()->race = def.race;
bat.get()->X = destX;
bat.get()->Y = destY;
+ if (def.race == "bat") {
+ bat.get()->health = 30;
+ }
placeables.push_back(bat);
b2BodyDef batBodyDef;
@@ -373,6 +376,9 @@ void GameRegion::Init(int x, int y, const std::string& worldName, bool forceRese
batDef.race = "bat";
SpawnMonster(batDef, 200.0f, 200.0f);
SpawnMonster(batDef, 1200.0f, 1400.0f);
+ MonsterDef beeDef = batDef;
+ beeDef.race = "bee";
+ SpawnMonster(beeDef, 220.0f, 220.0f);
}
void GameRegion::SaveRegion() {