generated from dvorakmortonxd/pygame-template
almost the last commit for the intro thing just missing the control cheatsheet ill commit in the next push
This commit is contained in:
parent
f316adc74c
commit
f7894f2040
4 changed files with 39 additions and 5 deletions
39
levels.py
39
levels.py
|
|
@ -42,8 +42,11 @@ def level1(screen, sheet, screen_width, screen_height, lastclickpos, basicfont,
|
|||
return level # this returns the change we made to the level so that it updates in main.py
|
||||
def level2(blip, screen, sheet, screen_width, screen_height, lastclickpos, basicfont, mouse, click, big_text, level, tick, slightfont, pygamemixer): # the function for our first level, ignore the unused variables here, you can use them when you edit it
|
||||
global tickd, dialognum, DIALOGTEXT
|
||||
if dialognum != 9:
|
||||
if dialognum not in [9, 11]:
|
||||
tickd += 1
|
||||
else:
|
||||
if tickd < 500:
|
||||
tickd += 1
|
||||
if tickd == 59:
|
||||
pygame.mixer.Sound.play(blip)
|
||||
if tickd in range(60,501):
|
||||
|
|
@ -69,23 +72,49 @@ def level2(blip, screen, sheet, screen_width, screen_height, lastclickpos, basic
|
|||
DIALOGTEXT = ""
|
||||
screen.blit(load_sprite(sheet, 0, 37, 57,36, 912, 576), (0,0))
|
||||
screen.blit(load_sprite(sheet,57,15,8,25, 80, 250), (660, 290))
|
||||
screen.blit(load_sprite(sheet, 65, 14, 54, 12, 162, 36), (720, 295))
|
||||
screen.blit(load_sprite(sheet, 65, 14, 13, 5, 65, 25), (710, 285))
|
||||
if dialognum == 8:
|
||||
DIALOGTEXT = "Oh..."
|
||||
screen.blit(load_sprite(sheet, 0, 37, 57,36, 912, 576), (0,0))
|
||||
screen.blit(load_sprite(sheet,57,15,8,25, 80, 250), (660, 290))
|
||||
screen.blit(load_sprite(sheet, 65, 14, 54, 12, 162, 36), (720, 295))
|
||||
screen.blit(load_sprite(sheet, 65, 14, 13, 5, 65, 25), (710, 285))
|
||||
dialog_square = pygame.surface.Surface((800, 68), pygame.SRCALPHA)
|
||||
dialog_square.fill((0, 0, 0))
|
||||
screen.blit(dialog_square, (56, 500))
|
||||
if dialognum == 9:
|
||||
DIALOGTEXT = "Press <H> to hide your parasite"
|
||||
DIALOGTEXT = "Press <H> to hide yourself"
|
||||
screen.blit(load_sprite(sheet, 0, 37, 57,36, 912, 576), (0,0))
|
||||
screen.blit(load_sprite(sheet,57,15,8,25, 80, 250), (660, 290))
|
||||
screen.blit(load_sprite(sheet, 65, 14, 54, 12, 162, 36), (720, 295))
|
||||
screen.blit(load_sprite(sheet, 65, 14, 13, 5, 65, 25), (710, 285))
|
||||
dialog_square = pygame.surface.Surface((800, 68), pygame.SRCALPHA)
|
||||
dialog_square.fill((0, 0, 0))
|
||||
screen.blit(dialog_square, (56, 500))
|
||||
if dialognum == 10:
|
||||
DIALOGTEXT = "Yep, that's whats going on.."
|
||||
screen.blit(load_sprite(sheet, 0, 37, 57,36, 912, 576), (0,0))
|
||||
screen.blit(load_sprite(sheet,57,15,8,25, 80, 250), (660, 290))
|
||||
dialog_square = pygame.surface.Surface((800, 68), pygame.SRCALPHA)
|
||||
dialog_square.fill((0, 0, 0))
|
||||
screen.blit(dialog_square, (56, 500))
|
||||
if dialognum == 11:
|
||||
DIALOGTEXT = "Press <Space> to get up."
|
||||
screen.blit(load_sprite(sheet, 0, 37, 57,36, 912, 576), (0,0))
|
||||
screen.blit(load_sprite(sheet,57,15,8,25, 80, 250), (660, 290))
|
||||
dialog_square = pygame.surface.Surface((800, 68), pygame.SRCALPHA)
|
||||
dialog_square.fill((0, 0, 0))
|
||||
screen.blit(dialog_square, (56, 500))
|
||||
if dialognum == 12:
|
||||
DIALOGTEXT = "I'm the parasite..."
|
||||
screen.blit(load_sprite(sheet, 0, 37, 57,36, 912, 576), (0,0))
|
||||
screen.blit(load_sprite(sheet,57,40,6,28, 60, 280), (600, 290))
|
||||
dialog_square = pygame.surface.Surface((800, 68), pygame.SRCALPHA)
|
||||
dialog_square.fill((0, 0, 0))
|
||||
screen.blit(dialog_square, (56, 500))
|
||||
if dialognum == 13:
|
||||
DIALOGTEXT = ""
|
||||
screen.blit(load_sprite(sheet, 0, 37, 57,36, 912, 576), (0,0))
|
||||
screen.blit(load_sprite(sheet,57,15,8,25, 80, 250), (660, 290))
|
||||
level = 3
|
||||
dialog = basicfont.render(DIALOGTEXT, True, transparency)
|
||||
if len(DIALOGTEXT) < 16:
|
||||
DX = 456-len(DIALOGTEXT)*9
|
||||
|
|
|
|||
5
main.py
5
main.py
|
|
@ -37,7 +37,12 @@ def main(fps=window_fps): # the main function
|
|||
levels.dialognum += 1
|
||||
if event.key == pygame.K_h:
|
||||
if levels.dialognum == 9:
|
||||
levels.tickd = 0
|
||||
levels.dialognum = 10
|
||||
if event.key == pygame.K_SPACE:
|
||||
if levels.dialognum == 11:
|
||||
levels.tickd = 0
|
||||
levels.dialognum = 12
|
||||
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
|
||||
|
|
|
|||
BIN
sprites.png
BIN
sprites.png
Binary file not shown.
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
BIN
sprites.pxo
BIN
sprites.pxo
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue