Beispiel #1
0
 
def collisionsOn():
    duckBody.physControls.setCollisionsActive(True)
    duckBody.physControls.isAirborne = True
def collisionsOff():
    duckBody.physControls.setCollisionsActive(False)
    duckBody.physControls.isAirborne = True
def toggleCollisions():
    if duckBody.physControls.getCollisionsActive():
        duckBody.physControls.setCollisionsActive(False)
        duckBody.physControls.isAirborne = True
    else:
        duckBody.physControls.setCollisionsActive(True)
        duckBody.physControls.isAirborne = True
base.accept('f1', toggleCollisions)
duckBody.collisionsOn = collisionsOn
duckBody.collisionsOff = collisionsOff
duckBody.toggleCollisions = toggleCollisions
 
localAvatar = duckBody
base.localAvatar = localAvatar
 
loadCogishAscent = True
if len(argv) > 1:
    filepath = argv[1]
    if '.' in filepath:
        try:
            execfile(filepath)
            loadCogishAscent = False
        except Exception, e:
            loadCogishAscent = False
 
def collisionsOn():
    catBody.physControls.setCollisionsActive(True)
    catBody.physControls.isAirborne = True
def collisionsOff():
    catBody.physControls.setCollisionsActive(False)
    catBody.physControls.isAirborne = True
def toggleCollisions():
    if catBody.physControls.getCollisionsActive():
        catBody.physControls.setCollisionsActive(False)
        catBody.physControls.isAirborne = True
    else:
        catBody.physControls.setCollisionsActive(True)
        catBody.physControls.isAirborne = True
base.accept('f1', toggleCollisions)
catBody.collisionsOn = collisionsOn
catBody.collisionsOff = collisionsOff
catBody.toggleCollisions = toggleCollisions
 
localAvatar = catBody
base.localAvatar = localAvatar

loadHub = True
if len(argv) > 1:
    filepath = argv[1]
    if '.' in filepath:
        try:
            execfile(filepath)
            loadHub = False
        except Exception, e:
            loadHub = False
Beispiel #3
0
    mouseBody.physControls.setCollisionsActive(True)
    mouseBody.physControls.isAirborne = True


def collisionsOff():
    mouseBody.physControls.setCollisionsActive(True)
    mouseBody.physControls.isAirborne = True


def toggleCollisions():
    if mouseBody.physControls.getCollisionsActive():
        mouseBody.physControls.setCollisionsActive(False)
        mouseBody.physControls.isAirborne = True
    else:
        mouseBody.physControls.setCollisionsActive(True)
        mouseBody.physControls.isAirborne = True


mouseBody.collisionsOn = collisionsOn
mouseBody.toggleCollisions = toggleCollisions

localAvatar = mouseBody
base.localAvatar = localAvatar

Ground = loader.loadModel(
    'phase_4/models/neighborhoods/toontown_central_full.bam')
Ground.reparentTo(render)

sky = loader.loadModel('phase_3.5/models/props/TT_sky.bam')
sky.reparentTo(render)
Beispiel #4
0
def collisionsOff():
    duckBody.physControls.setCollisionsActive(False)
    duckBody.physControls.isAirborne = True


def toggleCollisions():
    if duckBody.physControls.getCollisionsActive():
        duckBody.physControls.setCollisionsActive(False)
        duckBody.physControls.isAirborne = True
    else:
        duckBody.physControls.setCollisionsActive(True)
        duckBody.physControls.isAirborne = True


base.accept('f1', toggleCollisions)
duckBody.collisionsOn = collisionsOn
duckBody.collisionsOff = collisionsOff
duckBody.toggleCollisions = toggleCollisions

localAvatar = duckBody
base.localAvatar = localAvatar

loadCogishAscent = True
if len(argv) > 1:
    filepath = argv[1]
    if '.' in filepath:
        try:
            execfile(filepath)
            loadCogishAscent = False
        except Exception, e:
            loadCogishAscent = False
def collisionsOff():
    toonBody.physControls.setCollisionsActive(False)
    toonBody.physControls.isAirborne = True


def toggleCollisions():
    if toonBody.physControls.getCollisionsActive():
        toonBody.physControls.setCollisionsActive(False)
        toonBody.physControls.isAirborne = True
    else:
        toonBody.physControls.setCollisionsActive(True)
        toonBody.physControls.isAirborne = True


base.accept('f1', toggleCollisions)
toonBody.collisionsOn = collisionsOn
toonBody.collisionsOff = collisionsOff
toonBody.toggleCollisions = toggleCollisions
localAvatar = toonBody
base.localAvatar = localAvatar
localAvatar.physControls.placeOnFloor()
onScreenDebug.enabled = True

def updateOnScreenDebug(task):

    onScreenDebug.add('Avatar Position', localAvatar.getPos())
    onScreenDebug.add('Avatar Angle', localAvatar.getHpr())

    return Task.cont

base.taskMgr.add(updateOnScreenDebug, 'UpdateOSD')
def collisionsOff():
    toonBody.physControls.setCollisionsActive(False)
    toonBody.physControls.isAirborne = True


def toggleCollisions():
    if toonBody.physControls.getCollisionsActive():
        toonBody.physControls.setCollisionsActive(False)
        toonBody.physControls.isAirborne = True
    else:
        toonBody.physControls.setCollisionsActive(True)
        toonBody.physControls.isAirborne = True


base.accept('f1', toggleCollisions)
toonBody.collisionsOn = collisionsOn
toonBody.collisionsOff = collisionsOff
toonBody.toggleCollisions = toggleCollisions
localAvatar = toonBody
base.localAvatar = localAvatar
localAvatar.physControls.placeOnFloor()
onScreenDebug.enabled = True


def updateOnScreenDebug(task):

    onScreenDebug.add('Avatar Position', localAvatar.getPos())
    onScreenDebug.add('Avatar Angle', localAvatar.getHpr())

    return Task.cont