Light Racer 2.0 - Days 23-24 - New Graphics

My project plan called for the completion of the levels in the game and then on to do more work on the AI, but I decided instead to take a couple of days to finish up some odds and ends that I have been spending too much time thinking about, which came to be graphics improvements, zooming, player indicators and scoring. These two days have done more for the overall feel and polish of the game than anything I have done so far. The zooming got me to thinking about different ways to make 2D games interesting. I still have 6-8 weeks left of development to get Light Racer 2 and Light Racer 3D done but I'm already thinking about how I can use what I've learned on this project in my next game. Anyway, here is what was done on days 23 and 24.

Day 23 - what was done

Finished level configurations - Added power cross.
I positioned the power cross so that players could sneak behind them.
Tested all 10 levels a few times to make sure the game felt complete.
Created and put in a nicer looking sci-fi background
Started working on camera effects

I ended up slowing down the speeds for the last 5 levels because the game just felt too fast. The new map objects really add depth to the game and the extra speed is just unnecessary.

Here are some samples of how the completed levels look:

Light Racer 2 - Level 2Light Racer 2 - Level 2 Light Racer 2 - Level 3Light Racer 2 - Level 3 Light Racer 2 - Level 5Light Racer 2 - Level 5

Day 24 - what was done

I added camera effects and tweaked the background a little bit. I also implemented the score and level up on top. I wanted the score to render quickly so instead of using Android views for those text labels I made the entire screen the custom game view and have the main thread rendering text to the top. Since this increased the size of the surface view, I had to use a transform matrix on the canvas that the game renders to. That moved the game down 30 pixels and game me room to put the informational header up on top.

Here's how the zoom code works:

Matrix m = canvas.getMatrix();
// this moves the whole scene down to make room for the info header
m.postTranslate(0, INFO_HEADER_HEIGHT);
// this is the player currently controlled by the person playing the game
Player thisPlayer = this.thisPlayer;
// zoom is adjusted by the update() method and uses interpolation to get a constant rate.
float zoom = this.zoom;
if (thisPlayer != null && zoom > ZOOM_MIN) {
// zoom in on player
int centerX = world.width / 2;
int centerY = world.height / 2;
// center on player
// zoom in
// posFactor is a number between 0f and 1f that represents how completely we are zoomed. 0 is not at all.
float posFactor = (zoom - ZOOM_MIN) / (ZOOM_MAX - ZOOM_MIN);
// multiply the centering times the zoom factor to bring us back to 0,0 at the end of the zoom.
m.postTranslate((centerX - thisPlayer.curX) * posFactor, (centerY - thisPlayer.curY) * posFactor);
// scale to the zoom
m.postScale(zoom, zoom);
// compensate for the zoom throwing off the center.
m.postTranslate(centerX * (zoom - 1) * -1, centerY * (zoom - 1) * -1);
}
canvas.setMatrix(m);

I added a blinking player indicator showing who your player is and what direction they are starting in. I made one of each in blue, yellow and red.

I think the game looks much nicer now. The last 2 days of work have really made it come together and feel more polished and complete.

Light Racer 2 - Zoom with player indicatorLight Racer 2 - Zoom with player indicator