Warrior refactor completed
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
+6
-6
@@ -119,14 +119,14 @@ bool Monster::Update(float fElapsedTime){
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!game->GetPlayer().HasIframes()&&game->GetPlayer().OnUpperLevel()==OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(game->GetPlayer().GetPos(),12*game->GetPlayer().GetSizeMult()/2))){
|
||||
geom2d::line line(pos,game->GetPlayer().GetPos());
|
||||
if(!game->GetPlayer()->HasIframes()&&game->GetPlayer()->OnUpperLevel()==OnUpperLevel()&&geom2d::overlaps(geom2d::circle(pos,12*size/2),geom2d::circle(game->GetPlayer()->GetPos(),12*game->GetPlayer()->GetSizeMult()/2))){
|
||||
geom2d::line line(pos,game->GetPlayer()->GetPos());
|
||||
float dist = line.length();
|
||||
SetPosition(line.rpoint(-0.1));
|
||||
vel=line.vector().norm()*-128;
|
||||
}
|
||||
if(state==NORMAL){
|
||||
if(game->GetPlayer().GetX()>pos.x){
|
||||
if(game->GetPlayer()->GetX()>pos.x){
|
||||
facingDirection=RIGHT;
|
||||
} else {
|
||||
facingDirection=LEFT;
|
||||
@@ -137,7 +137,7 @@ bool Monster::Update(float fElapsedTime){
|
||||
targetAcquireTimer=std::max(0.f,targetAcquireTimer-fElapsedTime);
|
||||
if(targetAcquireTimer==0){
|
||||
targetAcquireTimer=3;
|
||||
target=geom2d::line(pos,game->GetPlayer().GetPos()).upoint(1.2);
|
||||
target=geom2d::line(pos,game->GetPlayer()->GetPos()).upoint(1.2);
|
||||
state=MOVE_TOWARDS;
|
||||
hasHitPlayer=false;
|
||||
}
|
||||
@@ -169,11 +169,11 @@ bool Monster::Update(float fElapsedTime){
|
||||
if(queueShotTimer<0){
|
||||
queueShotTimer=0;
|
||||
{
|
||||
BULLET_LIST.push_back(std::make_unique<Bullet>(Bullet(pos + vf2d{ 0,-4 }, geom2d::line(pos + vf2d{ 0,-4 }, game->GetPlayer().GetPos()).vector().norm() * 24 * 3.f, 2, GetAttack(),upperLevel,false, { 75 / 2,162 / 2,225 / 2 })));
|
||||
BULLET_LIST.push_back(std::make_unique<Bullet>(Bullet(pos + vf2d{ 0,-4 }, geom2d::line(pos + vf2d{ 0,-4 }, game->GetPlayer()->GetPos()).vector().norm() * 24 * 3.f, 2, GetAttack(),upperLevel,false, { 75 / 2,162 / 2,225 / 2 })));
|
||||
}
|
||||
}
|
||||
}
|
||||
geom2d::line line(pos,game->GetPlayer().GetPos());
|
||||
geom2d::line line(pos,game->GetPlayer()->GetPos());
|
||||
if(targetAcquireTimer==0&&queueShotTimer==0){
|
||||
targetAcquireTimer=1;
|
||||
if(line.length()<24*6){
|
||||
|
||||
Reference in New Issue
Block a user