Page MenuHome

BGE : subclass with more than 1 argument.
ClosedPublic

Authored by Porteries Tristan (panzergame) on Apr 14 2015, 9:11 PM.

Details

Summary

In the BGE you can't create a subclass with more than 1 argument like : "player = Player(owner, 10)"
I have modified the py_base_new to check only the first argument of args tuple.
Now we can do :

class Player(types.KX_GameObject):
    def __init__(self, gameobj, life):
        print("create new player :", self, ", life :", life)

player = Player(own, 50)

Diff Detail

Repository
rB Blender
Branch
ge_python_proxy_multi_args