Sunday, March 30, 2014

Racing game: Missing features

I've had these for a long time now but never bothered to screenshot them. I was going to wait until I had a proper UI for them but I may not have time to put that together anymore.
Maybe I never noticed it before but we now have a HUD assignment in programming class, one requirement is a speedometer.
The speedometer is straightforward. I didn't try to make the output accurate to real world scale but instead based it roughly on the top speed of a Wiesmann GT MF5.

At first I had the Wrong Way code set up with a Next Checkpoint variable that was driven by a list of checkpoints I had put in order. This worked perfectly but required manual labor for anyone wanting to use the code. I attempted to make it procedural by swapping the A>B and A<B and measuring from the last checkpoint you touch, but because of the way Touch and Gate work, the WRONG WAY message always appears briefly when switching to the next checkpoint. I did figure out several ways to fix the problem but it really should just work like this.
This still isn't good enough because it doesn't take into account which way you're supposed to go, only whether or not you're moving away from the last checkpoint you touched. Since all checkpoints already need to be facing the direction the player is supposed to go, I figured I could compare their Yaws and any time opposite values within a certain threshold were returned, it would allow WRONG WAY to be drawn. I briefly tested getting the Rotation and the Rotation Vector but neither seemed to be outputting the local object rotation and since switching back to the Next Checkpoint method would solve the problem anyway, I didn't bother experimenting further.