Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import pygame,sys
  2.  
  3. screen=pygame.display.set_mode([640,480])
  4. screen.fill([255,255,255])
  5. pygame.display.flip()
  6.  
  7. clock=pygame.time.Clock()
  8. stage=1
  9.  
  10.  
  11. def startingScreen():
  12. for events in pygame.event.get():
  13. if events.type==pygame.QUIT:
  14. pygame.quit()
  15. sys.exit()
  16.  
  17. if events.type==pygame.MOUSEBUTTONDOWN:
  18. print("mouse clicked")
  19. mouse_x,mouse_y=pygame.mouse.get_pos()
  20. print("Current position of mouse is ",mouse_x," ",mouse_y)
  21.  
  22. if (mouse_x>=220 and mouse_y>=282) \
  23. and (mouse_x<=435 and mouse_y>=282) \
  24. and(mouse_x>=220 and mouse_y<=350) \
  25. and (mouse_x<=435 and mouse_y<=350):
  26. print("Going to the next screen")
  27.  
  28. img=pygame.image.load('start.png')
  29. screen.blit(img,[0,0])
  30.  
  31. def gamePlay():
  32. screen.fill([12,123,244])
  33.  
  34. while True:
  35.  
  36. startingScreen()
  37. pygame.display.flip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement