This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/python/intern
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
..
2.5
2009-06-18 19:25:58 +00:00
2009-04-01 12:43:07 +00:00
2009-06-05 12:48:58 +00:00
2009-06-05 12:48:58 +00:00
2009-06-18 19:51:22 +00:00
2008-11-29 13:36:08 +00:00
2009-06-20 13:53:14 +00:00
2009-06-14 12:53:47 +00:00
2009-06-23 00:09:26 +00:00