Nadav-01 / Physics_Game

School project based on 2d physics. Written in Java. Pretty crappy, nothing to see here.
0 stars 0 forks source link

Black ball goes left when starting the program and inputting up. #1

Closed Nadav-01 closed 5 years ago

Nadav-01 commented 5 years ago

Up movement doesn't work as intended at the start of the program. When inputting up (or when the ball bounces up and not inputting anything) the ball will move left even though the speed vector doesn't show any change (still points up and not diagonally left). After inputting left or right, up movement returns to how it is intended.

Nadav-01 commented 5 years ago

Bug happened because location values were integers, and any small change made them round down. I replaced x and y values in all Items to doubles and casted the values to int when drawing them on the window.