diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-11 06:45:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-11 06:45:27 +0400 |
commit | 21fd09c028dce833f58cdaa8a1ff45876a5e5a2f (patch) | |
tree | cf5f7b60f9abc253cc7fb811ab05ab2782d3144d /release/scripts/templates/gamelogic_simple.py | |
parent | 0c50bedd9c960763d3e8e695b63957a964565be0 (diff) |
bmesh py api: change .from_mesh() / .to_mesh() to be class methods of BMesh rather than functions in the module.
added example script which converts a mesh to a bmesh, edits and converts back again.
Diffstat (limited to 'release/scripts/templates/gamelogic_simple.py')
-rw-r--r-- | release/scripts/templates/gamelogic_simple.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/release/scripts/templates/gamelogic_simple.py b/release/scripts/templates/gamelogic_simple.py new file mode 100644 index 00000000000..dbfcf948b18 --- /dev/null +++ b/release/scripts/templates/gamelogic_simple.py @@ -0,0 +1,17 @@ +import bge + + +def main(): + + cont = bge.logic.getCurrentController() + own = cont.owner + + sens = cont.sensors['mySensor'] + actu = cont.actuators['myActuator'] + + if sens.positive: + cont.activate(actu) + else: + cont.deactivate(actu) + +main() |