import bge cont = - TopicsExpress



          

import bge cont = bge.logic.getCurrentController() cubetwo = cont.owner #scene orientation scene = bge.logic.getCurrentScene() #scene objects sphere = scene.objects[Sphere] icosphere = scene.objects[Icosphere] #sensors for controllers keyboard = bge.logic.keyboard def main(): checkkeyboardevents() checkobjposition() def checkkeyboardevents(): if bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.WKEY]: cubetwo.localPosition.y += 0.01 #cubetwo.localPosition.y += 1.01 if bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.DKEY]: cubetwo.applyRotation([0.0, 0.0, 0.2], False) if bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.AKEY]: #cubetwo.applyForce([-0.4, 0.0, 0.0], True) cubetwo.applyForce([0.0, 120.0, 0.0], True) checkobjposition #end of main routine def checkobjposition(): # constant respawn after certain magnitude or length is reached if cubetwo.localPosition.y
Posted on: Sat, 01 Nov 2014 18:39:21 +0000

Trending Topics



Recently Viewed Topics




© 2015