Re: I found a very weird thingy in python!

You'd be surprised at just how often a typo or something stupid like that can trip up even the most experienced programmer for hours on end. Hm, another possibility might be your use of globals, you usually have to specify globals when using them inside functions because of the local/non-local way python handles variables, are you using python 2.x or 3.x?

server.set_output_device("default")
e.orientation = 0, 1, 0, 0, 0, 1
e.position.value=(0, 0, 0)

x = 0
y = 0
z = 0

@window.event
def on_key_press(symbol, modifiers):
    global x
    global y
    global z
    if symbol == key.C:
        Tolk.output("%d, %d, %d" %(x, y, z))
    elif symbol == key.W:
        x+=1
    if symbol == key.Q:
        sys.exit()
@window.event
def on_draw():
    window.clear()

pyglet.app.run()
_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : kianoosh via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : kianoosh via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : kianoosh via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : kianoosh via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : kianoosh via Audiogames-reflector

Reply via email to