Light Racer 2.0 - Day 11 - Invincibility

Today I set out to develop the invincibility item. The idea is that when picked up, the player will be invincible for 3 seconds and be able to break through trails, but the outer walls will still kill the player. My plan was to develop the invincibility code, build the item graphics and then put it all together in the game as an item that can be picked up. I first got side-tracked by how ugly the items were and decided to build uniform items for the game. I spent a few hours in photoshop making animated, 3d, orb-looking items. After that I got the trail-breaking code working, with a few bugs.

In photoshop, I basically made a grey sphere that would be the basis for all items. I then created a lighting effect that would shade it. I applied the lighting effect to it and some blending options and called it my orb. For each item, I then made the graphic that would be on the front of the orb and then duplicated the layer for each animation frame. I colored the layers according to how I wanted them to animate. I then applied the same lighting effect to each layer so they would look like they are part of the whole orb. I then created each frame of animation and set the layers for those.

Here are some photos of what things looked like in photoshop:

Invincibility Item First Try: This was too bright in-gameInvincibility Item First Try: This was too bright in-game Uncolored Invincibility Item with Layers in Photoshop: This is what it looks like before any effects are applied.Uncolored Invincibility Item with Layers in Photoshop: This is what it looks like before any effects are applied.
Light Racer 2.0 - Invincibility Item with layers in photoshop after effects: With lighting effects but before the blending effects on the orbLight Racer 2.0 - Invincibility Item with layers in photoshop after effects: With lighting effects but before the blending effects on the orb Light Racer 2.0 - New Speed Boost Item before effectsLight Racer 2.0 - New Speed Boost Item before effects
Light Racer 2.0 - Final Items in Photoshop with layersLight Racer 2.0 - Final Items in Photoshop with layers All items in photoshop with animation framesAll items in photoshop with animation frames

There is an easy way to save all animation frames as separate PNGs in photoshop but I need them to be as small as possible so I had to save them all frame-by-frame using the save-for-web-and-devices option. This made each one 1k instead of 3-4 that the default save does. The animation was just to preview before I finally saved the PNGs.

I added a new collision check method and supporting methods that will break trails apart when collided with. This way any game object will be able to use it. There were a few bugs with it initially but I was able to get it all working correctly in short-order. I added an invincible flag to the player and set it to true by default to test. I think some sort of sound and graphic will be needed when the player goes through a wall, but for now just having the physics and trail management work correctly is making me happy.

1 Comment

Post a comment here or discuss this and other topics in the forums

png optimization

hey Robert, you should try PNGout, by Ken Silverman ( the guy behind Duke Nukem 3D's engine )!
I use it all the time with my JME projects and it does wonders where the JAR size counts and 20K is luxury.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.