|
|
|
@ -33,6 +33,8 @@ bool Crawler::OnUserCreate(){ |
|
|
|
|
|
|
|
|
|
InitializeLevel("assets/Campaigns/1_1_test.tmx",CAMPAIGN_1_1); |
|
|
|
|
|
|
|
|
|
ConsoleCaptureStdOut(true); |
|
|
|
|
|
|
|
|
|
ClassData::InitializeClassData(); |
|
|
|
|
|
|
|
|
|
//Initialize Camera.
|
|
|
|
@ -644,7 +646,7 @@ void Crawler::UpdateBullets(float fElapsedTime){ |
|
|
|
|
if(!b->deactivated){ |
|
|
|
|
if(b->friendly){ |
|
|
|
|
for(Monster&m:MONSTER_LIST){ |
|
|
|
|
if(geom2d::overlaps(geom2d::circle(m.GetPos(),12*m.GetSizeMult()),geom2d::circle(b->pos,b->radius))){ |
|
|
|
|
if(b->OnUpperLevel()==m.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(m.GetPos(),12*m.GetSizeMult()),geom2d::circle(b->pos,b->radius))){ |
|
|
|
|
if(b->hitList.find(&m)==b->hitList.end()&&m.Hurt(b->damage)){ |
|
|
|
|
if(!b->hitsMultiple){ |
|
|
|
|
if(b->MonsterHit(m)){ |
|
|
|
@ -660,7 +662,7 @@ void Crawler::UpdateBullets(float fElapsedTime){ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if(geom2d::overlaps(geom2d::circle(player.GetPos(),12*player.GetSizeMult()/2),geom2d::circle(b->pos,b->radius))){ |
|
|
|
|
if(b->OnUpperLevel()==player.OnUpperLevel()&&geom2d::overlaps(geom2d::circle(player.GetPos(),12*player.GetSizeMult()/2),geom2d::circle(b->pos,b->radius))){ |
|
|
|
|
if(player.Hurt(b->damage)){ |
|
|
|
|
if(b->PlayerHit(player)){ |
|
|
|
|
it=BULLET_LIST.erase(it); |
|
|
|
@ -695,9 +697,9 @@ void Crawler::UpdateBullets(float fElapsedTime){ |
|
|
|
|
outsidePlayerBulletLoop: |
|
|
|
|
int a; |
|
|
|
|
} |
|
|
|
|
void Crawler::HurtEnemies(vf2d pos,float radius,int damage){ |
|
|
|
|
void Crawler::HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel){ |
|
|
|
|
for(Monster&m:MONSTER_LIST){ |
|
|
|
|
if(geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(m.GetPos(),12*m.GetSizeMult()))){ |
|
|
|
|
if(m.OnUpperLevel()==upperLevel&&geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(m.GetPos(),12*m.GetSizeMult()))){ |
|
|
|
|
m.Hurt(damage); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|