Hi there,
I am currently at chapter 7 and I am having a problem...
I've already implemented the spawning enemies and their movements, along with the HP display.
Now I am at the projectiles part, and they are not being created...
At this point, the game should be firing bullets and missiles (without homing feature).
The fire() method is being called by the player and the enemies, and the flag is changing.
When the flag is active, the mFireCommand created at the Aircraft Constructor is being pushed in the CommandQueue in the checkProjectileLaunch() method.
Analogous with the launchMissile() method.
But while debugging I've noticed, the createBullets() and createProjectile() methods are never executed, so no Projectile is being created.
What could be the problem? I followed the code from GitHub, must have missed something, but I've been checking and rechecking for hours and couldn't find whats wrong :/
Any hints?
Everything else is working as espected, and the application compiles just fine.
// Edit
As i tought, it was something to do with the Command delivery to the SceneNode by its Category...
but i was looking at the wrong place all the time, rechecking the Categories of the Entities.
I spent 3h+ to find out that i was missing this line in the World::buildScene()
Category::Type category = (i == Air) ? Category::SceneAirLayer : Category::None;
Now it is working o/
// New edit
Just finished Chapter 7... it was a tough one
But I am really excited with this book, SFML and game development.
It is the first time I have the feeling that I'm programming a game that is not so hardcoded and coupled.
The simple, yet enlightener architecture provided is perfect for newcomers to the game development area who likes to program and don't want to learn how to use a game engine before creating something simple and concise.