Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- auto_slika = pg.image.load("auto.png")
- (sirina_auta, visina_auta) = (auto_slika.get_width(), auto_slika.get_height())
- auto_v = 100
- auto_x = 0
- auto_y = visina - visina_auta
- frejmova_u_sekundi = 25
- dt = 1 / frejmova_u_sekundi
- def crtaj():
- prozor.fill(pg.Color("white"))
- prozor.blit(auto_slika, (auto_x, auto_y))
- def novi_frejm():
- global auto_x
- auto_x += auto_v * dt
- if auto_x > sirina:
- auto_x = - sirina_auta
- crtaj()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement