Advertisement
phjoe

Pac Face

Dec 12th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # pac face
  2. # joe, 12/12/2014
  3.  
  4. import appuifw as A
  5. import graphics
  6. import math
  7.  
  8. def radians(degrees):
  9.  return degrees*math.pi/180.0
  10. def degrees(radians):
  11.  degrees=180*radians/math.pi
  12.  return degrees
  13. math.radians=radians
  14. math.degrees=degrees
  15. ###########################
  16.  
  17. run=1
  18. def stop():
  19.  global run
  20.  run=0
  21.  
  22. A.app.screen='full'
  23. A.app.body=c=A.Canvas()
  24. A.app.exit_key_handler=stop
  25. w,h=c.size
  26. img=graphics.Image.new((w,h))
  27.  
  28. x,y=w/2,h/2
  29. R=min(x,y)*.80
  30. while run:
  31.  for deg in range(30):
  32.   img.clear(0)
  33.   img.pieslice((x-R,y-R,x+R,y+R),math.radians(deg),math.radians(360-(deg*2)),fill=0xffff00)
  34.   px=x+(R*.65)* math.cos(math.radians(60))
  35.   py=y+(R*.65)* -math.sin(math.radians(60))
  36.   img.point((px,py),0,width=20)
  37.   c.blit(img)
  38.   A.e32.ao_sleep(1e-02)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement