Most work this week was dedicated to the Last Pilot project. I attempted to spawn debris when an enemy died – while it seemed like a small scale task, it proved very difficult and I had to leave it for later.
I ported over my code to spawn various classes of enemy which succeeded, and 3 different enemies are now randomly chosen from to spawn at the top of the screen. However, I realised that during the process of editing the debris code I had disabled bullet to enemy collision as well as undeclaring enemy health values, both of which need to be remedied to move on to adding more complex classes like bosses.
The second important issue is that the enemies aren’t shooting; this could be due to the bullet physics group not working (player and enemy bullets should be unique physics groups), the direction of the bullets being wrong or their collision with the enemies shooting them.
Coding considerations for next week:
- Turn bullet direction into a function of X and Y velocity
- Separate enemy and player bullets into 2 physics groups
- Simplify debris code – the issue may be due to how the debris object is being carried into the opacity function
- Rewrite collision code to apply to the correct bullet types