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