Fixed a few problematic bugs and updated the buttons.
There were two major bugs that I fixed today:
- Lane merging: Cars would often get stuck trying to merge when other cars also wanted to merge. This was because the merging positon was behind the actual car so they were in a deadlock. Fixed it by making sure to actualy update the new merge position if the car still has velocity.
- Button press: Pressing a button which switched to a new screen would press the button on the new screen directly under the press. This took me embarassly long to debug, mostly because evey time I put a breakpoint, the issue would go away. The fix was changing the initilization of a button from isPressed false to true, which was pretty funny considering I spent 30 minutes debugging this.
I also updated the buttons and added a 4th level where cars are going both directions. It’s actually pretty hard to reach the target.
I also changed the pathfinding to take into account the speed limit of the road and put penalties for going through routes with more intersections.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.