Alright, time to take a break from untangling Recast and Detour and time to create an enemy in order to attach pathfinding. The Copy object was previously a struct, so I upgraded it to be an inherited copy of the Enemy that would go twice as fast. I had quite a bit of trouble understanding why things like the model's name that would be used as an index from the Enemy and Copy object did not transfer properly; seems like if the Enemy and Copy objects aren't pointers, the copy constructor messes up the transfer of information.
Along with that, I also cleaned up a couple of lines involving getting members from Copies; since Copy isn't a struct, it's best to use get/set methods so the information is transferred properly; there was a problem referencing the correct copy when the Copy was recycled, and it had a reference to "Copy0" when it was "Copy1" when remaking a copy. Luckily enough, everything's all set with that initial framework.
I also added movement via deltaTime to the player and enemy; without a proper managing of speed in regards to frameRate, the movement was quite jagged until the fix. Luckily I already put in some code for deltaTime to measure when the copies would die.
Next up is figuring out how to implement pathfinding for Enemies and Copies...
No comments:
Post a Comment