blender/source/gameengine
Campbell Barton 9a7ea9664e BGE PyAPI support for subclassing any BGE game type from python, scripters define extra functions on gameObjects.
Adding a UI to set the type on startup can be added easily.

# ----
class myPlayer(GameTypes.KX_GameObject):
  def die(self):
    # ... do stuff ...
    self.endObject()

# make an instance
player = myPlayer(gameOb) # gameOb is made invalid now.
player.die()

# ----

One limitation (which could also be an advantage), is making the subclass instance will return that subclass everywhere, you cant have 2 different subclasses of the same BGE data at once.
2009-06-29 12:06:46 +00:00
..
BlenderRoutines 2.5 2009-06-28 18:09:19 +00:00
Converter BGE PyAPI support for subclassing any BGE game type from python, scripters define extra functions on gameObjects. 2009-06-29 12:06:46 +00:00
Expressions BGE PyAPI support for subclassing any BGE game type from python, scripters define extra functions on gameObjects. 2009-06-29 12:06:46 +00:00
GameLogic BGE PyAPI support for subclassing any BGE game type from python, scripters define extra functions on gameObjects. 2009-06-29 12:06:46 +00:00
GamePlayer Spring Cleaning 2009-06-21 16:18:38 +00:00
Ketsji BGE PyAPI support for subclassing any BGE game type from python, scripters define extra functions on gameObjects. 2009-06-29 12:06:46 +00:00
Network 2.50: 2009-06-08 20:08:19 +00:00
Physics Spring Cleaning 2009-06-21 16:18:38 +00:00
PyDoc BGE Action Actuator setChannel() function was broken in a number of ways. 2009-06-16 18:25:48 +00:00
Rasterizer merged from trunk 20741:20848 2009-06-13 11:09:13 +00:00
SceneGraph 2.50: 2009-06-08 20:08:19 +00:00
VideoTexture BGE Py API using python3 c/api calls. include bpy_compat.h to support py2.x 2009-06-29 02:25:54 +00:00
CMakeLists.txt Spring Cleaning 2009-06-21 16:18:38 +00:00
Makefile Makefile fixes for compiling with new videotexture code. 2008-11-02 18:12:45 +00:00
SConscript Spring Cleaning 2009-06-21 16:18:38 +00:00