Replace main.py

上级 9e39fc29
......@@ -2,21 +2,6 @@ import pygame,sys,threading,pygame.locals,pygame.font
pygame.init()
'''def check_events(ai_settings, screen, stats, play_button, ship, bullets):
#键鼠响应
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
elif event.type == pygame.KEYDOWN:
check_keydown_events(event, ai_settings, screen, ship, bullets)
elif event.type == pygame.KEYUP:
check_keyup_events(event, ship)
elif event.type == pygame.MOUSEBUTTONDOWN:
mouse_x, mouse_y = pygame.mouse.get_pos()
check_play_button(stats, play_button, mouse_x,
mouse_y)
'''
def New_window(window_x,window_y,window_name,background):
screen = pygame.display.set_mode((window_x,window_y),0,32)
pygame.display.set_caption(window_name)
......@@ -32,6 +17,7 @@ def New_file(screen,file_imarge,file_x,file_y,file_text,text_x,text_y,text_color
screen.blit(file_imarge,(file_x,file_y))
screen.blit(file_text,((text_x+file_x),(text_y+file_y)))
return None
def New_button(function,screen,event,button_imarge,button_down_imarge,button_x,button_y,text,text_x,text_y,text_color,text_S,text_font,text_bold,text_italic):
if event == MOUSEBUTTONDOWN:
mouse_x, mouse_y = pygame.mouse.get_pos()
......@@ -44,13 +30,16 @@ def first_window():
with open('./sys/first_window/window.txt',encoding='UTF-8') as files:
file = files.readlines()
window_x,window_y = int(file[0].rstrip()),int(file[1].rstrip())
first_window,first_window_background = New_window(window_x,window_y,'说我(TAM) ——定义你自己','first_window')
with open('./sys/first_window/title.txt',encoding='UTF-8') as files:
file = files.readlines()
title = file[0].rstrip()
title_x,title_y = int(file[1].rstrip()),int(file[2].rstrip())
title_S,title_color = int(file[3].rstrip()),(int(file[4].rstrip()),int(file[5].rstrip()),int(file[6].rstrip()))
title_bold,title_italic = bool(file[6].rstrip()),bool(file[7].rstrip())
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册