Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-06-29 16:06:46 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-06-29 16:06:46 +0400
commit9a7ea9664e27679935adaea3093630d7a6a30b5d (patch)
tree96d706f511e571c490f33a4b1702a48c53033723 /source/gameengine/GameLogic/SCA_NORController.cpp
parent7ca31bb171b2c94f8e9b928990363a42af8716fb (diff)
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.
Diffstat (limited to 'source/gameengine/GameLogic/SCA_NORController.cpp')
-rw-r--r--source/gameengine/GameLogic/SCA_NORController.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp
index 67e0916ecc1..9762d44fd5d 100644
--- a/source/gameengine/GameLogic/SCA_NORController.cpp
+++ b/source/gameengine/GameLogic/SCA_NORController.cpp
@@ -115,16 +115,15 @@ PyTypeObject SCA_NORController::Type = {
0,
0,
py_base_repr,
- 0,0,0,0,0,0,
- NULL, //py_base_getattro,
- NULL, //py_base_setattro,
- 0,
+ 0,0,0,0,0,0,0,0,0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
0,0,0,0,0,0,0,
Methods,
0,
0,
- &SCA_IController::Type
+ &SCA_IController::Type,
+ 0,0,0,0,0,0,
+ py_base_new
};
PyMethodDef SCA_NORController::Methods[] = {