Creating the Wall classes
The next step in our project is going to be creating the Wall
classes. We will have two types of walls:
- A normal wall, which will block the enemy’s line of sight, the player character, and the dodgeball.
- A ghost wall, which will only block the player character, and ignore the enemy’s line of sight and the dodgeball. You may find this type of collision setup in specific types of puzzle games.
We’ll create both these Wall classes in the next exercise.
Exercise 6.04 – creating Wall classes
In this exercise, we will be creating the Wall
classes that represent both a normal Wall
and a GhostWall
, which will only block the player character’s movement, but not the enemies’ lines of sight or the dodgeballs they throw.
Let’s start with the normal Wall
class. This C++ class will be empty because the only thing that it’ll need is a mesh to reflect the projectiles and block the enemies...