Merging gamacon

This commit is contained in:
Anonymus Raccoon
2020-05-01 15:37:59 +02:00
4 changed files with 5 additions and 3 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

+2 -2
View File
@@ -172,7 +172,7 @@
<gc_entity> <gc_entity>
<transform_component> <transform_component>
<Position x="0" y="0" /> <Position x="0" y="0" />
<Size x="48" y="96" /> <Size x="70" y="90" />
</transform_component> </transform_component>
<renderer src="farmer1"> <renderer src="farmer1">
<Rect height="32" width="24" top="64" left="24" /> <Rect height="32" width="24" top="64" left="24" />
@@ -189,7 +189,7 @@
<gc_entity> <gc_entity>
<transform_component> <transform_component>
<Position x="0" y="0" /> <Position x="0" y="0" />
<Size x="48" y="96" /> <Size x="70" y="90" />
</transform_component> </transform_component>
<renderer src="mayor"> <renderer src="mayor">
<Rect height="32" width="24" top="64" left="24" /> <Rect height="32" width="24" top="64" left="24" />
+2
View File
@@ -14,6 +14,8 @@ unsigned int amount)
if (this->dead) if (this->dead)
return; return;
this->health -= amount; this->health -= amount;
if (this->health < 0)
this->health = 0;
engine->trigger_event(engine, "rem_health", this->health, amount); engine->trigger_event(engine, "rem_health", this->health, amount);
if (this->health <= 0) if (this->health <= 0)
this->dead = true; this->dead = true;
+1 -1
View File
@@ -25,7 +25,7 @@ enum gc_mousekeys key)
if (!hc) if (!hc)
return (true); return (true);
hc->dead = false; hc->dead = false;
hc->health = hc->health_max; hc->health = hc->health_max * 0.4;
for (gc_list *li = list; li; li = li->next) { for (gc_list *li = list; li; li = li->next) {
if (!my_strcmp(GETCMP(li->data, tag_component)->tag, "game_over")) if (!my_strcmp(GETCMP(li->data, tag_component)->tag, "game_over"))
((gc_entity *)li->data)->destroy(li->data, scene); ((gc_entity *)li->data)->destroy(li->data, scene);