Day 7: Energy Crystals

Development time: 2 hours

Using Fireworks I created a crystal / gem image and exported two sizes (20px and 40px).  Then when asteroids were exploding I assigned a random chance that a gem would be produced.  I then created a function that would handle gem creation, and another that would handle gem collection.  

I put this all together and tried it out, however the ship would only collect gems when it was moving.  I turned on hybrid draw mode for the physics engine and found that the physics body for the ship was "sleeping" while it wasn't being moved.  So I told the physics engine to never let the ship body go to sleep and it all worked.  Finally I assigned a value to the amount of energy to be gained by collecting each gem.  There is definitely some game balancing that will have to be done, right now it's too easy to never lose ship energy.

Next: Day 8

Get Asteroid Blasteroid

Download NowName your own price

Leave a comment

Log in with to leave a comment.