当前位置:网站首页>Catch ball game 1

Catch ball game 1

2022-07-06 20:11:00 Melon eating crowd +1

import pygame
# initialization
pygame.init()

# Create screen ( main window ), And return to the current screen
screen = pygame.display.set_mode((600,500))
pygame.display.set_caption(“ Catch games ”)
x,y=0,0
# Cycle through the screen ( display screen )
while True:
for event in pygame.event.get():
# If you close the window , Then quit the game
if event.type == pygame.QUIT:
pygame.quit()
# Press the keyboard KEYDOWN
if event.type == pygame.KEYDOWN:
print(‘abc’)
# The mouse click MOUSEBUTTONDOWN

# Fill color of main window 
screen.fill((100,0,0))
# A circle ( canvas ,rgb Color ,xy Location , radius , Line width )
pygame.draw.circle(screen,(100,100,30),(x,y),30,0)
x+=1
y+=1
# Render the screen 
pygame.display.update()

11

原网站

版权声明
本文为[Melon eating crowd +1]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131233596350.html