generated from sigonasr2/CPlusPlusProjectTemplate
Fixed node collision spots and added hurricane node
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
9763f62226
commit
1bd636d93a
@ -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.
@ -84,3 +84,4 @@
|
||||
14;69;METEORSHOWER_NODE
|
||||
202;33;METEORSTORM_NODE
|
||||
167;44;SNOWSTORM_NODE
|
||||
20;10;HURRICANE_NODE
|
||||
Loading…
x
Reference in New Issue
Block a user