Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. auto_slika = pg.image.load("auto.png")
  2. (sirina_auta, visina_auta) = (auto_slika.get_width(), auto_slika.get_height())
  3.  
  4. auto_v = 100
  5. auto_x = 0
  6. auto_y = visina - visina_auta
  7. frejmova_u_sekundi = 25
  8. dt = 1 / frejmova_u_sekundi
  9.  
  10. def crtaj():
  11. prozor.fill(pg.Color("white"))
  12. prozor.blit(auto_slika, (auto_x, auto_y))
  13.  
  14. def novi_frejm():
  15. global auto_x
  16. auto_x += auto_v * dt
  17. if auto_x > sirina:
  18. auto_x = - sirina_auta
  19. crtaj()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement