Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.98 KB | None | 0 0
  1. '''
  2.  
  3.     СКАЧАТЬ ЛОЛЮ: https://imgur.com/a/epTldMS
  4.  
  5. '''
  6.  
  7. from tkinter import *
  8. from time import *
  9.  
  10. root = Tk()
  11. print("[CORE] Enabling: imported tkinter")  # LOGGER
  12.  
  13. root.resizable(False, False)  # made root aka canvas not able to resize
  14. root.title("АНИМЕ ПОМОЙКА")
  15. print('[CORE] Added some parameters to root: resizability and title')
  16.  
  17. girl = PhotoImage(file='girl_2.png')  # anime girl import lmao
  18.  
  19. def draw_bus(x, y):  # x = 50, y = 100
  20.     canvas.create_rectangle(x, y-50, x+100, y, fill='#7289DA')  # a fucking BUS dude
  21.     canvas.create_oval(x, y, x+25, y+25, fill='black')  # yyeeahhaw thats a wheel
  22.     canvas.create_oval(x+75, y, x+100, y+25, fill='black')  # one more wheel
  23.     canvas.create_rectangle(x+90, y-20, x+100, y-10, fill="yellow")  # ahahah that's a light dude
  24.     canvas.create_image(x+25, y-50, image=girl, anchor=NW)
  25.     print('[CANVAS] Created a bus LOL')
  26.  
  27.  
  28. def draw_environment():
  29.     canvas.create_rectangle(0, 125, 800, 210, fill="green", outline='green')  # let's plant some fucking grass mate
  30.     print('[CANVAS] Planted fucking grass')
  31.     canvas.create_oval(750, -50, 850, 50, fill='yellow')  # Hier kommt die Sonne
  32.     print('[CANVAS] Hier kommt die Sonne')
  33.     canvas.create_text(400, 150, text="лоля катается лол", font="Times 30 bold")
  34.  
  35.  
  36. print('[CORE] Associated new variable for tkinter')  # LOGGER
  37.  
  38. canvas = Canvas(root, width=800, height=200, bg='light blue')  # some parameters for a window
  39. canvas.pack()
  40. print('[CORE] Added canvas and packed it oh hell yeah!')  # LOGGER
  41.  
  42. # draw_environment()  # calls some plants and stuff
  43. # draw_bus(50, 100)  # calls amazing drawing function from the top of a code
  44.  
  45. x = 0 # base variables for the fucking bus
  46. y = 120
  47.  
  48. while True:
  49.     if x == 0: side = 1
  50.     else: side = -1
  51.     for i in range(700):
  52.         canvas.update()
  53.         sleep(0.008)
  54.         canvas.delete('all')
  55.         x += side
  56.         draw_environment()
  57.         draw_bus(x, y)
  58.  
  59.  
  60. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement