blender/source
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
..
blender 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
creator more corrections from cleanup :/ 2009-06-21 17:03:17 +00:00
darwin * Updated the Mac OS X blender and .blend file icons to support 2009-05-21 13:39:47 +00:00
gameengine 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
icons Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
kernel 2.50: 2009-06-08 20:08:19 +00:00
CMakeLists.txt 2.50: 2009-06-08 20:08:19 +00:00
Makefile Spring Cleaning 2009-06-21 16:18:38 +00:00
nan_compile.mk Spring Cleaning 2009-06-21 16:18:38 +00:00
nan_definitions.mk Spring Cleaning 2009-06-21 16:18:38 +00:00
nan_link.mk Spring Cleaning 2009-06-21 16:18:38 +00:00
nan_subdirs.mk Makefile updates for Blender 2.5 (from GSR) 2009-03-19 01:50:45 +00:00
nan_warn.mk Makefile updates for Blender 2.5 (from GSR) 2009-03-19 01:50:45 +00:00
SConscript 2009-03-30 18:21:17 +00:00