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

Objects going beyond walls #7

Closed Nadav-01 closed 5 years ago

Nadav-01 commented 5 years ago

if fast enough, objects can clip through walls and leave the playing area. Solution- use prediction code to see the objects will clip through the wall next frame, and if they do, collide early and set the coordinates in the point of predicted collision (not inside the wall).

Nadav-01 commented 5 years ago

In current code, if a projectile is out of bounds it is teleported to inside the bounds. Still needs to make sure clipping doesnt happen if possible.

Nadav-01 commented 5 years ago

Way to fix: implement isOverlap and fixOverlap with walls.

Nadav-01 commented 5 years ago

Tried to implement; sometimes causes balls to exit boundaries without enough speed to actually do move through the wall. Fix the methods.

Nadav-01 commented 5 years ago

Implemented. Didnt see it happen since. Will reopen if it happens again.