Another week of programming on the bus gone by. I haven't really figured out how I'm going to format this blog but I think for now I'll just kind of run through the things I did each day. The first thing I tackled was an easy one, just resetting the player's velocity when teleporting them back to the beginning of the level. Before putting that in if the player was moving too fast like if he'd fallen off the edge and I needed to reset him back to the beginning he'd be going so fast he'd fly right through the floor.
The next thing to tackle were my menubars, and let me tell you I had a hell of a time with getting those menubars working again. The menubars were one of the first pieces of my UI that I got working and the code had evolved quite a bit over the course of getting everything working. Needless to say there was some weirdness with how the coordinates were set up and I just could not wrap my head around what I needed to offset to get the mouse coordinates into the right space. The right thing to do would have been to just rewrite them to better match how things were currently working in the more updated UI elements but instead I just hammered on it for 2 days until it started working haha. Definitely sucks losing 2 mornings and 2 evenings to a menu. It's nice having them working now though, I've hooked up all the various windows that I had floating around so I can toggle them visible and invisible. Previously all I could do was click the close button in the corner of the window and it would be gone until the next session.
|Shot of the main menu|
|Here's a shot of the editor in voxel sprite edit mode.|
|Here's a shot of the first collectable, a coin.|
There was also a few little tweaks I made. I adjusted the gameplay camera a little bit, moved it up a little bit and removed the horizontal offset I had in place. I also tweaked the color on the tweakable menu so I could see it a little better. I also added a tool to the main menu for duplicating the level 4 times to generate the 4 lanes that the player will race in. I also found a major bonehead error in my bulk frustum check that was resulting in some serious performance issues. I was doing a frustum test on all of the objects in my scene, however the function that performs the frustum check takes an array of aabb's and I was stupidly calling that function once for every object, which squared the number of frustum checks I was doing!!!! So dumb, it doubled my performance getting rid of that stupid loop. Oh yeah I also put in my first pass at the character for the game! He still needs a name though, and trying to figure out the final style for him, whether I extrude certain blocks or make him totally 3d voxelated.
|Shot of the tweakable menu|
|Shot from the current game camera|