The basic structure for our game is there, we need to start to make it more interesting now. Our Boss could use some work. All he does right now is move up and down.
Not exactly Boss like.
The Boss Shoots
Step 1 in making the game more interesting is having the Boss on every level actually shoot at the player.
This is actually pretty simple because of the work we did creating the character and projectile classes and their methods.
Boss Bullets Hurt
Now that the Boss is shooting, we need to make sure that projectiles that hit the player follow the same kind of rules that the player’s projectiles do. When they hit the player, they should damage the character and then disappear.
This means adding a little more logic to our CustomeEngine’s OnObjectCollision method.
Now when you play the game, if the player character gets hit by one of the Boss’ projectiles, it should get damaged and the projectile should disappear.
Extra Projectiles for the Boss
It seems like the Boss should be a little more powerful. Shooting one bullet at a time seems a little weak. So we are going to have our Boss shoot 3 bullets at once. That should make it feel a little more challenging.
To do this, we are going to slightly modify our CreateProjectile method to take a width and height offset from the character that is shooting. This will also come in handy later when we want to add powerups.
Your Boss should now be a worthy opponent firing 3 bullets at once.
Time for a Theme
All of our hard work is starting to pay off. We now have a framework for setting up levels with a Big Bad Boss at the end of each one that can move and shoot at the player.
Next we will start adding some images to the game to give it a theme.