Advertisement
iful99

kata brgerak segitiga

Nov 14th, 2014
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import appuifw,graphics,e32
  2.  
  3. def quit():
  4.   global play
  5.   play = 0
  6.  
  7. appuifw.app.exit_key_handler = quit
  8. appuifw.app.screen = 'full'
  9. appuifw.app.body = c = appuifw.Canvas()
  10. layar = c.size
  11. im = graphics.Image.new(layar)
  12.  
  13. t1=[10,220]
  14. t2=[40,200]
  15. t3=[70,180]
  16. t4=[100,100]
  17. t5=[130,50]
  18. t6=[160,100]
  19. t7=[190,180]
  20. t8=[220,200]
  21. t9=[240,220]
  22.  
  23. an=[t1,t2,t3,t4,t5,t6,t7,t8,t9]
  24. s=0
  25. d=0
  26.  
  27. def animasi():
  28.   global d,s
  29.   if d <= 0:
  30.     d = 6
  31.     s += 1
  32.   if d > 0:d -=1
  33.   if s > len(an)-1:s=0
  34.   im.text((an[s],an[s]),u'hore',0xff00ff,(u'',30))
  35.  
  36. play = 1
  37. while play:
  38.   im.clear(0)
  39.   animasi()
  40.   c.blit(im)
  41.   e32.ao_sleep(0.01)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement