I’m making a tank object, which will be run by a single script, which controls all its actuators and does everything neatly within methods. When a tank object is instantiated, it is added to the GameLogic module in a list and can be found by checking its unique ID.
ANYWAY. I’m currently integrating a particle effect into a method called “explode()”, which will make the tank appear to explode. The problem is that the method doesn’t seem to recognise that range() is a function in this method, and not a global variable as it believes. Can you work out what I’m doing wrong?
There is an issue I’ve encountered within BGE python a few times. It seems builtin is not automatically imported in classes, IIRC. You’ll have to import builtin yourself or you may even have to pass the builtin module as an argument for your class. I don’t recall exactly how I got around it anymore.
Woohoo!!! Thanks jplur! Your idea worked great! Now check out the mighty awesomage that is my low poly, exploding tank!
Basically, each particle is designed to follow a vector from the centre of the object to each vertex. This way, a round explosion can be created. You can change the mesh to anything you like and see the different explosion effects.