|
|
|
@ -115,11 +115,8 @@ void Crawler::InitializeAnimations(){ |
|
|
|
|
|
|
|
|
|
void Crawler::HandleUserInput(float fElapsedTime){ |
|
|
|
|
bool setIdleAnimation=true; |
|
|
|
|
if(GetKey(PGUP).bHeld){ |
|
|
|
|
player.SetZ(player.GetZ()+5*fElapsedTime); |
|
|
|
|
} |
|
|
|
|
if(GetKey(PGDN).bHeld){ |
|
|
|
|
player.SetZ(std::max(0.f,player.GetZ()-5*fElapsedTime)); |
|
|
|
|
if(GetKey(SPACE).bPressed){ |
|
|
|
|
player.Spin(Player::GROUND_SLAM_SPIN_TIME,14*PI); |
|
|
|
|
} |
|
|
|
|
if(GetKey(RIGHT).bHeld){ |
|
|
|
|
if(player.GetPos().x+12+fElapsedTime*100*player.GetMoveSpdMult()<WORLD_SIZE.x*24){ |
|
|
|
@ -262,7 +259,7 @@ void Crawler::RenderWorld(float fElapsedTime){ |
|
|
|
|
for(Monster&m:monstersBefore){ |
|
|
|
|
view.DrawPartialDecal(m.GetPos()-vf2d{12,12}*m.GetSizeMult(),m.GetFrame().GetSourceImage()->Decal(),m.GetFrame().GetSourceRect().pos,m.GetFrame().GetSourceRect().size,vf2d(m.GetSizeMult(),m.GetSizeMult())); |
|
|
|
|
} |
|
|
|
|
view.DrawPartialDecal(player.GetPos()-vf2d{12,12}*player.GetSizeMult()+vf2d{0,-player.GetZ()},player.GetFrame().GetSourceImage()->Decal(),player.GetFrame().GetSourceRect().pos,player.GetFrame().GetSourceRect().size,vf2d(player.GetSizeMult(),player.GetSizeMult())); |
|
|
|
|
view.DrawPartialRotatedDecal(player.GetPos()+vf2d{0,-player.GetZ()},player.GetFrame().GetSourceImage()->Decal(),player.GetSpinAngle(),{12,12},player.GetFrame().GetSourceRect().pos,player.GetFrame().GetSourceRect().size,vf2d(player.GetSizeMult(),player.GetSizeMult())); |
|
|
|
|
for(Monster&m:monstersAfter){ |
|
|
|
|
view.DrawPartialDecal(m.GetPos()-vf2d{12,12}*m.GetSizeMult(),m.GetFrame().GetSourceImage()->Decal(),m.GetFrame().GetSourceRect().pos,m.GetFrame().GetSourceRect().size,vf2d(m.GetSizeMult(),m.GetSizeMult())); |
|
|
|
|
} |
|
|
|
|