generated from dvorakmortonxd/pygame-template
finally can hold the milk carton lmao
This commit is contained in:
parent
7151183ea5
commit
43716c7710
2 changed files with 40 additions and 4 deletions
8
main.py
8
main.py
|
|
@ -29,6 +29,8 @@ def main(fps=window_fps): # the main function
|
|||
if event.type == pygame.KEYDOWN: # what happens when you press down a key
|
||||
if event.key == pygame.K_ESCAPE: # what happens when you press escape
|
||||
running = False # poof
|
||||
if event.key == pygame.K_k:
|
||||
level = 2.5
|
||||
if event.type == pygame.MOUSEBUTTONDOWN: # what happens when you press down a mouse button
|
||||
click = True # sets the click variable to True so level function in levels.py can see
|
||||
print(pygame.mouse.get_pos()) # prints out where the mouse is during the click for debugging purposes
|
||||
|
|
@ -45,6 +47,12 @@ def main(fps=window_fps): # the main function
|
|||
elif level == 2: # what happens when the level variable is equal to 2 ofc
|
||||
tick += 1
|
||||
level = levels.level2(screen, sheet, screen_width, screen_height, lastclickpos, basicfont, pygame.mouse, click, bigtext, level, tick, smalltext) # runs the level2 function from levels.py
|
||||
elif level == 2.5:
|
||||
tick = 0
|
||||
level = 3
|
||||
elif level == 3:
|
||||
level = levels.level3(screen, sheet, screen_width, screen_height, lastclickpos, basicfont, pygame.mouse, click, bigtext, level, tick, smalltext) # runs the level2 function from levels.py
|
||||
|
||||
fps_text = smalltext.render(str(int(clock.get_fps())), True, (0, 255, 0)) # defines a thing that renders your fps in the top left corner
|
||||
screen.blit(fps_text, (5, 5)) # this actually renders "ftp_text" on the screen at the position (5, 5) which is the top left corner
|
||||
pygame.display.flip() # this updates the display so it displays all the new stuff we added
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue