Esempio n. 1
0
    scene.post_draw = [animate]
    pbge.configure()
    
    # getting the reference of the created objects
    # for further modifications
    myplane = pbge.createPlane( -2,0,0 )
    mycube = pbge.createCube( 0,2,0 )
    mysphere = pbge.createSphere( 0,-2,0 )
    mycylinder = pbge.createCylinder( 2,0,0 )
    
    #let's place a spot
    myspot = pbge.createSpot( 0,0,7 )
    
    # all objects are created, 
    # let's change the position:
    pbge.moveTo( myplane, 0,0,-3 )
    # let's change the size:
    pbge.scale( myplane, 10 )
    pbge.scaleZ( mycube, 3 )
    # let's change the orientation:
    pbge.rotateX( mycylinder, 15 )
    

# called at each frame
def animate():
    pbge.update()

# always leave this at the bottom of the script!
if pbge.isconfigured() == False:
    init()
Esempio n. 2
0
from ProcessingBGE.ProcessingBGE import ProcessingBGE as pbge

if pbge.isconfigured():
    co = bge.logic.getCurrentController()
    mouse = co.sensors["Mouse"]

    # position
    pbge.mouseX = mouse.position[0] / bge.render.getWindowWidth()
    pbge.mouseY = mouse.position[1] / bge.render.getWindowHeight()

    # buttons
    lb = mouse.getButtonStatus(bge.events.LEFTMOUSE)
    mb = mouse.getButtonStatus(bge.events.MIDDLEMOUSE)
    rb = mouse.getButtonStatus(bge.events.RIGHTMOUSE)
    if lb == bge.logic.KX_INPUT_NONE or lb == bge.logic.KX_INPUT_JUST_RELEASED:
        pbge.mouseLeft = False
    else:
        pbge.mouseLeft = True

    if mb == bge.logic.KX_INPUT_NONE or mb == bge.logic.KX_INPUT_JUST_RELEASED:
        pbge.mouseMiddle = False
    else:
        pbge.mouseMiddle = True

    if rb == bge.logic.KX_INPUT_NONE or rb == bge.logic.KX_INPUT_JUST_RELEASED:
        pbge.mouseRight = False
    else:
        pbge.mouseRight = True
from ProcessingBGE.ProcessingBGE import ProcessingBGE as pbge

if pbge.isconfigured():
	co = bge.logic.getCurrentController()

#TODO