Commit b483e4f8 by BellCodeEditor

save project

parent 7acb59a8
Showing with 19 additions and 16 deletions
1.png

51.4 KB

apple.png

2.05 KB

bg.png

22.5 KB

i = 3 import pygame
username = "python" from pygame import locals
userpassword = "123456" pygame.init()
screen = pygame.display.set_mode((660,480))
background = pygame.image.load('bg.png')
food = pygame.image.load('apple.png')
car = pygame.image.load('1.png')
while True: while True:
if i>0: for event in pygame.event.get():
name = input("请输入用户名:") if event.type == locals.QUIT:
password = input("请输入密码:") #接受到退出时间后退出程序
i -=1
if name == username and password == userpassword:
print("登录成功!")
break
elif name != username:
print("用户名不存在,请重新输入!")
continue
else:
print("你的账户已被锁定,请一个小时后再来")
exit() exit()
print("欢迎来到贝尔编程!") screen.blit(background,(0,0))
screen.blit(car,(26,120))
screen.blit(food,(330,270))
screen.blit(food,(330,240))
screen.blit(food,(300,270))
screen.blit(food,(300,240))
pygame.display.update()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment