|
|
|
@ -24,7 +24,7 @@ void State_OverworldMap::OnStateChange(GameState*prevState){ |
|
|
|
|
game->GetPlayer()->SetSizeMult(1); |
|
|
|
|
}; |
|
|
|
|
void State_OverworldMap::OnUserUpdate(Crawler*game){ |
|
|
|
|
game->camera.SetTarget(currentConnectionPoint->rect.middle()); |
|
|
|
|
game->camera.SetTarget(currentConnectionPoint->rect.middle()+vf2d{game->GetScreenSize().x/6.0f,0}); |
|
|
|
|
game->UpdateCamera(game->GetElapsedTime()); |
|
|
|
|
game->GetPlayer()->Update(game->GetElapsedTime()); |
|
|
|
|
|
|
|
|
@ -65,7 +65,12 @@ void State_OverworldMap::OnUserUpdate(Crawler*game){ |
|
|
|
|
void State_OverworldMap::Draw(Crawler*game){ |
|
|
|
|
currentTime+=game->GetElapsedTime(); |
|
|
|
|
for(ConnectionPoint&cp:connections){ |
|
|
|
|
if(geom2d::overlaps(game->GetWorldMousePos(),cp.rect)){ |
|
|
|
|
if(!Unlock::IsUnlocked(cp)){ |
|
|
|
|
game->view.FillRectDecal(cp.rect.pos,cp.rect.size,{0,0,0,128}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for(ConnectionPoint&cp:connections){ |
|
|
|
|
if(Unlock::IsUnlocked(cp)&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect)){ |
|
|
|
|
float borderThickness=4; |
|
|
|
|
vf2d crosshairExtension={std::min(0.25f*cp.rect.size.x-borderThickness/2,12.f),std::min(0.25f*cp.rect.size.y-borderThickness/2,12.f)}; |
|
|
|
|
vf2d pulsatingAmt=vf2d{1,1}*std::abs(std::sin(currentTime*3))*2; |
|
|
|
|