Walls
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 dodge ball.
- A ghost wall, which will only block the player character, and ignore the enemy's line of sight and the dodge ball. You might 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 dodge balls they throw.
Let's start with the normal Wall
class. This C++ class will basically be empty because the only thing that it'll need is a mesh in order to reflect the projectiles and block the enemies' lines of sight...