Beispiel #1
0
        elif char==77 or char==67: #right
            ship.posX+=3
            if(collideWall()):
                ship.posX-=3
        elif char==72 or char==65: #up
            ship.posY-=2
            if(collideWall()):
                ship.posY+=2
        elif char==32: #shoot
            mObjects.append(Bullet(ship.posX+1, ship.posY))

    #spawn astroids
    astroidSpawner.spawnAstroid(mObjects)

    #Check collision
    collision.collision(mObjects, explosions)

    #move mObjects
    for mObject in mObjects:
        if(mObject.move(width, height)):
            mObjects.remove(mObject)

    #"Clear" the screen
    string = ""
    #for derp in range(500):
    #    print ""

    #Print info
    string += lost + "\n"
    string += "exit with q\n"