Fixed node collision spots and added hurricane node

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
sigonasr2 2022-08-27 22:50:22 -05:00
parent 9763f62226
commit 1bd636d93a
3 changed files with 6 additions and 5 deletions

View File

@ -833,11 +833,11 @@ public:
bool collidesWithPlayer(Object obj) {
if (obj.hasAnim) {
return PLAYER_COORDS[0]>=obj.x&&PLAYER_COORDS[0]<=obj.x+obj.anim->width&&
PLAYER_COORDS[1]>=obj.y&&PLAYER_COORDS[1]<=obj.y+obj.anim->height;
return PLAYER_COORDS[0]>=obj.x&&PLAYER_COORDS[0]<=obj.x+obj.anim->width/32.0&&
PLAYER_COORDS[1]>=obj.y&&PLAYER_COORDS[1]<=obj.y+obj.anim->height/32.0;
} else {
return PLAYER_COORDS[0]>=obj.x&&PLAYER_COORDS[0]<=obj.x+obj.spr->sprite->width&&
PLAYER_COORDS[1]>=obj.y&&PLAYER_COORDS[1]<=obj.y+obj.spr->sprite->height;
return PLAYER_COORDS[0]>=obj.x&&PLAYER_COORDS[0]<=obj.x+obj.spr->sprite->width/32.0&&
PLAYER_COORDS[1]>=obj.y&&PLAYER_COORDS[1]<=obj.y+obj.spr->sprite->height/32.0;
}
}
};

Binary file not shown.

View File

@ -84,3 +84,4 @@
14;69;METEORSHOWER_NODE
202;33;METEORSTORM_NODE
167;44;SNOWSTORM_NODE
20;10;HURRICANE_NODE