Fix Misery bubble going the wrong way (oops sorry) (#240)

This commit is contained in:
periwinkle 2023-09-28 04:18:51 -04:00 committed by GitHub
parent c2ad3dd643
commit bd203cfddb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ impl NPC {
self.target_x = npc.x;
self.target_y = npc.y;
let angle = ((self.y - self.target_y) as f64 / (self.x - self.target_x) as f64).atan();
let angle = f64::atan2((self.y - self.target_y) as f64, (self.x - self.target_x) as f64);
self.vel_x = (angle.cos() * -1024.0) as i32;
self.vel_y = (angle.sin() * -1024.0) as i32;
}