~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to release/scripts/templates/gamelogic_module.py

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This module can be accessed by a python controller with
2
 
# its execution method set to 'Module'
3
 
# * Set the module string to "gamelogic_module.main" (without quotes)
4
 
# * When renaming the script it MUST have a .py extension
5
 
# * External text modules are supported as long as they are at
6
 
#   the same location as the blendfile or one of its libraries.
7
 
 
8
 
import bge
9
 
 
10
 
# variables defined here will only be set once when the
11
 
# module is first imported. Set object specific vars
12
 
# inside the function if you intend to use the module
13
 
# with multiple objects.
14
 
 
15
 
 
16
 
def main(cont):
17
 
    own = cont.owner
18
 
 
19
 
    sens = cont.sensors['mySensor']
20
 
    actu = cont.actuators['myActuator']
21
 
 
22
 
    if sens.positive:
23
 
        cont.activate(actu)
24
 
    else:
25
 
        cont.deactivate(actu)
26
 
 
27
 
# dont call main(bge.logic.getCurrentController()), the py controller will