From d86fae78fc5a2674ec484e9e5b777847bd9e3882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Tue, 22 Oct 2019 18:20:03 +0200 Subject: [PATCH] Explode at player --- main.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index b9fd197..5229236 100755 --- a/main.c +++ b/main.c @@ -1713,7 +1713,19 @@ void SFG_gameStep() } } - if (p->doubleFramesToLive == 0) + if ( + (p->doubleFramesToLive == 0) || + SFG_elementCollides( + SFG_player.camera.position.x, + SFG_player.camera.position.y, + SFG_player.camera.height, + p->position[0], + p->position[1], + p->position[2], + 0, + 0 + ) + ) { eliminate = 1; } @@ -1735,14 +1747,14 @@ void SFG_gameStep() { if ( SFG_elementCollides( - p->position[0], - p->position[1], - p->position[2], SFG_MONSTER_COORD_TO_RCL_UNITS(m->coords[0]), SFG_MONSTER_COORD_TO_RCL_UNITS(m->coords[1]), SFG_floorHeightAt( SFG_MONSTER_COORD_TO_SQUARES(m->coords[0]), SFG_MONSTER_COORD_TO_SQUARES(m->coords[1])), + p->position[0], + p->position[1], + p->position[2], 0, 0) )