Added road hitboxes and placement restrictions!
Roads can no longer be placed overlapping other roads! Implementing this feature might seem really easy, but actually it was really, really annoying. One main problem was that SFML doesn’t have a native way to check if two sprites/rectangleShapes are intersecting so I had too implment the Separating Axis Theorem to check if two arbitray rectangles are intersecting. I also had some issues with rotating (wrong origin), but thankfully I fixed that pretty quick.
Anyway, I think the only thing left is to add all the road types (I’m planning on 1-lane one way, 2-lane one way, 2 lane road, 4 lane road, and maybe 6 lane road) and polish everything up!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.