Hello Im trying to get a working combat system going. I was able to have my player hit an enemy with an hp spvar with a spawned hit box sprite, after 4 hits he's defeated but I since changed the code to spawn an enemy at startup using Def. and the spawned hit box is also added using a Def. but now the enemy is not sensing the collision from the hit box.
Any help would be appreciated thanks
Need help with collisions with spawn objects SB 3ds
Thanks for the reply, but I figured it out. I had to rewrite the code and work on the collision.
A question though. I have a Def that handles the hit damage now when the hp reaches 0 and the enemy needs to be cleared after few seconds. Should I have a separate def function, to handle that?
Thanks
Well, personally, I like to create functions that serve unique objectives. Like, one function for spawning enemies, one function for handling damage dealt against enemies, one function for killing/despawning enemies, and so on.
I wouldn't say there's a rule of thumb on the matter, just use whatever layout works for you.