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:
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.