I'm coding a game - Part 5
Ahhh…Control C and Control V, is there anything you can’t do?
As you can see, the collisions for the object are exactly the same. Next I created some new variables for the enemy object.
The flash variable was a variable I used along with the “Shader” resource. This resource allows a coder to alter the pixels of an object in a variety of ways. Tweaking with the shader a coder can make an object darker, lighter, or change colors completely. I wanted to simulate the effect of the enemy lighting up when stuck by the player’s bullet. It just gives it that finishing touch feel, and a lot of these games can be hard to tell if enemy is hit or not.
The last bit of code I worked was the dying animation. With this code I set the hit points with the variable hp. When the hp is equal or less than zero, it runs the dying sequence.