generated from dvorakmortonxd/pygame-template
might aswell add the last changes before I unfinished the jam
This commit is contained in:
parent
8aa6154710
commit
a0e8d6a6ba
4 changed files with 47 additions and 11 deletions
22
levels.py
22
levels.py
|
|
@ -2,6 +2,9 @@ from render import load_sprite # this makes it so our function for rendering spr
|
|||
import pygame
|
||||
tickd = 0
|
||||
dialognum = 0
|
||||
playerx,playery = 596, 245
|
||||
oldpx, oldpy = 596, 245
|
||||
playerXc, playerYc = 0,0
|
||||
DIALOGTEXT = "UNDEFINED"
|
||||
def level1(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
|
||||
|
|
@ -13,7 +16,7 @@ def level1(screen, sheet, screen_width, screen_height, lastclickpos, basicfont,
|
|||
screen.blit(overlay, (0, 0))
|
||||
elif tickd > 450:
|
||||
tickd = 0
|
||||
mainmenu_text = slightfont.render("THE DESTROYER OF CITIES", True, (210, 210, 210))
|
||||
mainmenu_text = slightfont.render("THE LARVAE", True, (210, 210, 210))
|
||||
playb_collision = pygame.Rect(315, 200, 285, 105)
|
||||
exitb_collision = pygame.Rect(315, 350, 285, 105)
|
||||
if playb_collision.collidepoint(mouse.get_pos()):
|
||||
|
|
@ -38,10 +41,10 @@ def level1(screen, sheet, screen_width, screen_height, lastclickpos, basicfont,
|
|||
screen.blit(load_sprite(sheet, 57, 0, 19, 7, 285, 105), (315, 350))
|
||||
exit_text = basicfont.render("Exit", True, (255,255,255))
|
||||
screen.blit(exit_text, (414, 380))
|
||||
screen.blit(mainmenu_text, (45, 65))
|
||||
screen.blit(mainmenu_text, (255, 65))
|
||||
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
|
||||
global tickd, dialognum, DIALOGTEXT, playerx, playery
|
||||
if dialognum not in [9, 11]:
|
||||
tickd += 1
|
||||
else:
|
||||
|
|
@ -106,7 +109,7 @@ def level2(blip, screen, sheet, screen_width, screen_height, lastclickpos, basic
|
|||
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))
|
||||
screen.blit(load_sprite(sheet,57,40,6,28, 60, 280), (playerx, playery))
|
||||
dialog_square = pygame.surface.Surface((800, 68), pygame.SRCALPHA)
|
||||
dialog_square.fill((0, 0, 0))
|
||||
screen.blit(dialog_square, (56, 500))
|
||||
|
|
@ -114,7 +117,7 @@ def level2(blip, screen, sheet, screen_width, screen_height, lastclickpos, basic
|
|||
DIALOGTEXT = ""
|
||||
tickd = 0
|
||||
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,57,40,6,28, 60, 280), (600, 290))
|
||||
level = 3
|
||||
dialog = basicfont.render(DIALOGTEXT, True, transparency)
|
||||
if len(DIALOGTEXT) < 16:
|
||||
|
|
@ -136,10 +139,10 @@ def level2(blip, screen, sheet, screen_width, screen_height, lastclickpos, basic
|
|||
return level # returns the current level set
|
||||
|
||||
def level3(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
|
||||
global tickd, playerx, playery
|
||||
tickd += 1
|
||||
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,57,40,6,28, 60, 280), (playerx, playery))
|
||||
square = pygame.surface.Surface((812, 476), pygame.SRCALPHA)
|
||||
square.fill((0, 0, 0))
|
||||
if tickd < 255:
|
||||
|
|
@ -162,8 +165,7 @@ def level3(blip, screen, sheet, screen_width, screen_height, lastclickpos, basic
|
|||
return level
|
||||
|
||||
def level4(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
|
||||
tickd += 1
|
||||
global tickd,playerx,playery, playerXc, playerYc
|
||||
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,57,40,6,28, 60, 280), (playerx, playery))
|
||||
return level
|
||||
Loading…
Add table
Add a link
Reference in a new issue