Re: I want to lirn pithon but pithon doesn't want me to do so
actually I notessed that and fixed it, here is the code
from random import randint
from random import randrange
import timer
from speech import speak
import lucia
import sys
errors_log = open("errors.log", "a")
sys.stderr = errors_log
lucia.initialize()
p=lucia.audio_backend.SoundPool()
walktime=timer.timer
class player:
def __init__(self,x=0,y=0,z=0):
self.x=x
self.y=y
self.z=z
class tree:
def __init__(self,x=randint(0,30),y=randint(0,30)):
self.x=treex
self.y=treey
p.play_2d("treeloop.ogg",me.x,me.y,treex,treey,true)
def main():
lucia.show_window("treecrasher")
me=player()
while True:
if me.x<0:
me.x==0
if me.y<0:
me.y==0
if me.x>30:
me.x==30
if me.y>30:
me.y==30
lucia.process_events()
if lucia.key_down(lucia.K_UP) and walktime.elapsed>=500:
walktime.restart()
me.y+=1
elif lucia.key_down(lucia.K_DOWN) and walktime.elapsed>=500:
walktime.restart()
me.y-=1
elif lucia.key_down(lucia.K_LEFT) and walktime.elapsed>=500:
walktime.restart()
me.x-=1
elif lucia.key_down(lucia.K_RIGHT) and walktime.elapsed>=500:
walktime.restart()
me.x+=1
if lucia.key_pressed(lucia.K_ESCAPE):
lucia.quit()
main()
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector