Hi All,
As the title states, when I update the BaseCharacter.cpp tick function to handle leftright checks, movement, and velocity by copying code from my Character.cpp, my goblin texture is no longer being drawn. I am not sure why or how this happening.
Before Changes
Here is a screenshot of the program loading the correct goblin texture before the change to Character and Base Character is made.
BaseCharacter Header
Character.CPP tick function before movement of if-else is moved to base character. (Direction has been update to velocity.)
BaseCharacter tick function before changes.
After Changes
BaseCharacter Tick is updated with code from Character.
Character tick function after moving if-else statement. (BaseCharacter tick function call is moved to bottom so velocity is not zeroed out for movement.)
Results in program functioning as intended, but my goblin has become a knight. ( Knights are over lapping in this screen shot.)
My though is that the initialization of Texture2Ds texture, idle, and run in the BaseCharacter header is overriding the Enemy class instance in my Main.cpp, where I am passing the idle and run goblin sprites to the Enemy constructor.
What truly confuses me is that there has been no change to Texture2D variables directly, the only change I can think of is moving the BaseCharacter tick function call to the bottom of the Character tick function.
How could I fix the issue of the wrong sprite being drawn for the Enemy Goblin instance?
Sorry if this is word vomit, but I am truly deeply confused as to what is happening.
Thank you for any help that you can provide.
Spencer