Stupid bullet. Also fixed WIZARD_IDLE animations missing.

This commit is contained in:
2023-09-04 18:24:21 -05:00
parent cbfcb2793f
commit 6dcc7e736d
9 changed files with 89 additions and 33 deletions
+3 -8
View File
@@ -138,7 +138,7 @@ bool Crawler::OnUserCreate(){
}
bool Crawler::OnUserUpdate(float fElapsedTime){
fElapsedTime=std::clamp(fElapsedTime,0.f,1/60.f);
fElapsedTime=std::clamp(fElapsedTime,0.f,1/60.f); //HACK fix. We can't have a negative time. Although using a more precise system clock should make this never occur. Also make sure if the game is too slow we advance by only 1/60th of a second.
HandleUserInput(fElapsedTime);
UpdateEffects(fElapsedTime);
player->Update(fElapsedTime);
@@ -436,13 +436,8 @@ void Crawler::UpdateBullets(float fElapsedTime){
moveStep=(b->vel*fElapsedTime).norm();
}
while(totalDistance>0){
if(totalDistance>=1){
b->pos+=moveStep;
totalDistance--;
} else {
b->pos+=moveStep*totalDistance;
totalDistance=0;
}
totalDistance=std::max(0.f,totalDistance-1);
b->pos+=moveStep;
if(b->friendly){
for(Monster&m:MONSTER_LIST){
if(geom2d::overlaps(geom2d::circle(m.GetPos(),12*m.GetSizeMult()),geom2d::circle(b->pos,b->radius))){