I have a npc class which has a method called chase that is referenced inside the update function. when chase is called it says its not a function or it’s not defined. I have another method being referenced in the same way that works.
chase method.
chase is called at npc_spr.chase(); this creates an error while above the bullet_spr.updateMe() works. updateMe is also a method.
what I expected to happen was for the method to be called like the one above. I have tried many different ways of rewriting it but everything results in the not defined or not a function error.
I might not have explained very well. There’s two groups one for bullets and one for npcs. Both bullets and npcs have their own class. when I call a method from the bullet class (updateMe) it works but when I call a method from the npc class in the same way I get the error - Uncaught TypeError: npc_spr.chase is not a function. The only difference between the groups is that the npc group has a createMultiple and a small bit of code to randomly place the npcs