Hello everyone, i am new to the forum and i was hoping if you can help me with a problem i have. I'm trying to recreate original Asteroid game for fun, but am having problems with my collision detection. What am i currently using for collision detection is if 2 lines intersect function. I have a polygon array made of line segments and bullets flying from the ship, every "tick" or update predicts the movement of the bullet and makes a line segments between the current position(p1) and the future position(p2) and then makes a line between the two points and polygon lines, and if they intersect, then a collision happens and the new bullet position is the points of intersection and the bullet stops. Most of my bullets actually work and collide, but some of them jump over and i have no idea why.
I have attached the project, it is written in Delphi 10.
SpaceGameProto.zip
Also if someone can tell me why my "PointOfAngle"(Finds a point at given length from O at Angle) function doesn't work with precisely 90 degrees(180 & etc).
Thanks!
Bookmarks