Added end cinematic
@ -3,6 +3,7 @@
|
||||
## Musics
|
||||
|
||||
- Overworld : Kevin MacLeod - Itty Bitty 8 Bit
|
||||
- Level 1 : Jeremy Blake - Powerup
|
||||
- Level 2 : Quincas Moreira - Robot City
|
||||
- Level 3 : Kubbi - Up In My Jam
|
||||
- Level 1 & 6 : Jeremy Blake - Powerup
|
||||
- Level 2 & 5 : Quincas Moreira - Robot City
|
||||
- Level 3 & 4 : Kubbi - Up In My Jam
|
||||
- Intro and ending : The Whole Other - 8-Bit Dreamscape
|
||||
|
BIN
gamedata/assets/particles/confetti/blue/0.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
gamedata/assets/particles/confetti/blue/1.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
gamedata/assets/particles/confetti/blue/2.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
gamedata/assets/particles/confetti/red/0.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
gamedata/assets/particles/confetti/red/1.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
gamedata/assets/particles/confetti/red/2.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
gamedata/assets/particles/confetti/yellow/0.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
gamedata/assets/particles/confetti/yellow/1.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
gamedata/assets/particles/confetti/yellow/2.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
@ -91,6 +91,11 @@ class Game():
|
||||
self.globals["finishedlevels"] = [] # Levels where the player went to the end
|
||||
self.globals["completedlevels"] = [] # Levels where the player kicked all non-respawnable ennemies
|
||||
self.globals["speedrunlevels"] = [] # Levels where the player finished fast enough
|
||||
self.globals["speedrunlevels"] = list(range(5))
|
||||
self.globals["completedlevels"] = list(range(5))
|
||||
self.globals["overworld"] = True
|
||||
self.globals["nblevels"] = 0
|
||||
self.globals["levelname"] = None
|
||||
self.globals["allunlocked"] = True
|
||||
self.globals["bgms"] = ["city.ogg","docks.ogg","isle.ogg","isle.ogg","docks.ogg","city.ogg"]
|
||||
self.init_inputs()
|
||||
|
BIN
gamedata/maps/Level 6/background0.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
gamedata/maps/Level 6/background1.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
gamedata/maps/Level 6/background2.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
gamedata/maps/Level 6/background3.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
gamedata/maps/Level 6/background4.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
gamedata/maps/Level 6/base.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
gamedata/maps/Level 6/filler.png
Normal file
After Width: | Height: | Size: 11 KiB |
6345
gamedata/maps/Level 6/map.json
Normal file
@ -6,7 +6,10 @@ class Cinematic(BaseObject):
|
||||
def __init__(self,game):
|
||||
|
||||
super().__init__(0,0,game)
|
||||
|
||||
|
||||
self.bgm = self.game.sound_lib["bgm/cinematic.ogg"]
|
||||
self.bgm.play()
|
||||
|
||||
text = """More and more trash is being thrown away
|
||||
It's up to you now to clean everything up
|
||||
Watch out for the baddies !"""
|
||||
@ -25,7 +28,7 @@ Watch out for the baddies !"""
|
||||
self.depth = 2
|
||||
self.fill = game.pygame.Surface([self.game.globals["cameraw"],self.game.globals["camerah"]])
|
||||
self.fill.fill([62,33,55])
|
||||
|
||||
|
||||
self.totalheight = len(self.lines)*9+(len(self.lines)-1)*self.textpadding
|
||||
self.offset = (self.game.globals["camerah"]-self.totalheight)/2
|
||||
|
||||
@ -44,6 +47,10 @@ Watch out for the baddies !"""
|
||||
t = Transition(self.game)
|
||||
self.game.gameloop.summon(t)
|
||||
self.sfx.play()
|
||||
self.bgm.stop()
|
||||
|
||||
if self.game.inputs["keys"]["up"]["timer"]==1:
|
||||
self.timer.timer = 0
|
||||
|
||||
|
||||
def draw(self):
|
||||
|
87
gamedata/objects/endcinematic.py
Normal file
@ -0,0 +1,87 @@
|
||||
from gamedata.objects.base import BaseObject
|
||||
from gamedata.objects.transition import Transition
|
||||
|
||||
class EndCinematic(BaseObject):
|
||||
|
||||
def __init__(self,game):
|
||||
|
||||
super().__init__(0,0,game)
|
||||
|
||||
clean = len(game.globals["completedlevels"])==self.game.globals["nblevels"]
|
||||
speedrun = len(game.globals["speedrunlevels"])==self.game.globals["nblevels"]
|
||||
|
||||
self.bgm = self.game.sound_lib["bgm/cinematic.ogg"]
|
||||
self.bgm.play()
|
||||
|
||||
self.game.globals["levelname"]=None
|
||||
|
||||
text = """Good job finishing all those levels !
|
||||
But there's some trash left
|
||||
Try cleaning everything up !"""
|
||||
if clean:
|
||||
text = """Thanks for cleaning everything !
|
||||
Try to beat every level as fast as you can !"""
|
||||
if speedrun:
|
||||
text = """You were quick !
|
||||
But there's some trash left
|
||||
Try cleaning everything up !"""
|
||||
|
||||
if speedrun and clean:
|
||||
text = """Good job completing the game !
|
||||
You truly are amazing !"""
|
||||
|
||||
text+="""
|
||||
|
||||
Made by @justayte for the #Seajam
|
||||
Go support #TeamSeas"""
|
||||
|
||||
self.lines = text.split("\n")
|
||||
self.sprites = []
|
||||
for i in self.lines:
|
||||
self.sprites.append(game.getchars(i))
|
||||
|
||||
self.currentlines = 1
|
||||
|
||||
self.timer = game.lib.Timer(4)
|
||||
|
||||
self.textpadding = 10
|
||||
|
||||
self.depth = 2
|
||||
self.fill = game.pygame.Surface([self.game.globals["cameraw"],self.game.globals["camerah"]])
|
||||
self.fill.fill([62,33,55])
|
||||
|
||||
self.totalheight = len(self.lines)*9+(len(self.lines)-1)*self.textpadding
|
||||
self.offset = (self.game.globals["camerah"]-self.totalheight)/2
|
||||
|
||||
self.title = self.game.sprite_lib["title.png"]
|
||||
|
||||
self.sfx = self.game.sound_lib["sfx/return.wav"]
|
||||
|
||||
def step(self):
|
||||
|
||||
if self.currentlines < len(self.lines)+2 and self.timer.tick(self.game.dt):
|
||||
self.currentlines += 1
|
||||
if self.currentlines == len(self.lines):
|
||||
self.timer = self.game.lib.Timer(5)
|
||||
elif self.currentlines == len(self.lines)+2:
|
||||
# Spawn transition
|
||||
t = Transition(self.game)
|
||||
self.game.gameloop.summon(t)
|
||||
self.sfx.play()
|
||||
self.bgm.stop()
|
||||
|
||||
if self.game.inputs["keys"]["up"]["timer"]==1:
|
||||
self.timer.timer = 0
|
||||
|
||||
def draw(self):
|
||||
self.game.window.blit(self.fill,[0,0])
|
||||
|
||||
if self.currentlines<=len(self.lines):
|
||||
for i in range(self.currentlines):
|
||||
cx = self.game.globals["cameraw"]/2
|
||||
self.game.lib.drawcenter(self.game,self.sprites[i],cx,self.offset+i*(self.textpadding+9))
|
||||
else:
|
||||
cx = self.game.globals["cameraw"]/2
|
||||
cy = self.game.globals["camerah"]/2
|
||||
self.game.lib.drawcenter(self.game,self.title,cx,cy)
|
||||
|
@ -81,7 +81,7 @@ class TilesetRenderer(BaseObject):
|
||||
self.layers = []
|
||||
self.spawns = []
|
||||
self.bgm = None
|
||||
if "levelname" in self.game.globals.keys():
|
||||
if self.game.globals["levelname"]!=None and not self.game.globals["overworld"]:
|
||||
self.bgm = self.game.sound_lib["bgm/"+self.game.globals["bgms"][self.game.globals["levelname"]]]
|
||||
if self.bgm:
|
||||
self.bgm.play(-1)
|
||||
|
@ -10,6 +10,7 @@ class Levels(BaseObject):
|
||||
for i in nodes:
|
||||
self.nodes.append(i.copy())
|
||||
self.customvalues = customvalues
|
||||
self.game.globals["nblevels"] = len(self.nodes)
|
||||
|
||||
self.bgm = self.game.sound_lib["bgm/overworld.ogg"]
|
||||
self.bgm.play(-1)
|
||||
@ -55,7 +56,7 @@ class Levels(BaseObject):
|
||||
|
||||
self.animspeed = 7
|
||||
self.cursor = 0
|
||||
if "levelname" in self.game.globals.keys():
|
||||
if self.game.globals["levelname"]!=None:
|
||||
self.cursor = self.game.globals["levelname"] # Which level is selected
|
||||
self.playerx = self.nodes[self.cursor]["x"]
|
||||
self.playery = self.nodes[self.cursor]["y"]
|
||||
|
@ -10,7 +10,9 @@ class Results(BaseObject):
|
||||
self.maxcount = self.game.globals["totaltrashes"]
|
||||
self.currentcount = 0
|
||||
self.count = self.game.globals["trashes"]
|
||||
|
||||
|
||||
self.lastlevel = self.game.globals["nblevels"]-1==self.game.globals["levelname"]
|
||||
|
||||
self.maxtime = self.game.globals["timetobeat"]
|
||||
self.currenttime = 99
|
||||
self.time = min(99,self.game.globals["timer"])
|
||||
@ -44,7 +46,7 @@ class Results(BaseObject):
|
||||
self.transition = False
|
||||
|
||||
self.depth = 3
|
||||
|
||||
|
||||
self.centerx = self.game.globals["cameraw"]/2
|
||||
self.centery = self.game.globals["camerah"]/2
|
||||
|
||||
@ -61,7 +63,7 @@ class Results(BaseObject):
|
||||
if self.currentcount == self.maxcount: # Spawn sparkles
|
||||
self.game.addParticle(self.sparkles,self.centerx+150+self.game.globals["camerax"],self.centery+self.game.globals["cameray"],fps=6,depth=4)
|
||||
self.medalsfx.play()
|
||||
|
||||
|
||||
past = int(self.currenttime)
|
||||
self.currenttime-=self.game.dt
|
||||
self.currenttime+= (self.time- self.currenttime)*self.game.dt
|
||||
@ -81,7 +83,7 @@ class Results(BaseObject):
|
||||
for i in keys:
|
||||
self.transition = self.transition or self.game.inputs["keys"][i]["timer"]==1
|
||||
if self.transition:
|
||||
t = Transition(self.game)
|
||||
t = Transition(self.game,endcinematic=self.lastlevel)
|
||||
self.game.gameloop.summon(t)
|
||||
self.backsfx.play()
|
||||
|
||||
|
@ -2,7 +2,7 @@ from gamedata.objects.base import BaseObject
|
||||
|
||||
class Transition(BaseObject):
|
||||
|
||||
def __init__(self,game,time=0.7,holdtime=0,level=None):
|
||||
def __init__(self,game,time=0.7,holdtime=0,level=None,endcinematic=False):
|
||||
|
||||
super().__init__(0,0,game)
|
||||
|
||||
@ -11,6 +11,8 @@ class Transition(BaseObject):
|
||||
self.surface.fill(self.color)
|
||||
self.level = level
|
||||
|
||||
self.endcinematic = endcinematic
|
||||
|
||||
self.timer = game.lib.Timer(time)
|
||||
self.holdtimer = game.lib.Timer(holdtime)
|
||||
self.hold = False
|
||||
@ -21,7 +23,7 @@ class Transition(BaseObject):
|
||||
self.depth = 4
|
||||
|
||||
def step(self):
|
||||
|
||||
|
||||
if not self.hold:
|
||||
self.alpha = (1-self.timer.getratio())*255
|
||||
if self.timer.tick(self.game.dt):
|
||||
@ -29,10 +31,16 @@ class Transition(BaseObject):
|
||||
self.alpha = 255
|
||||
else:
|
||||
if self.holdtimer.tick(self.game.dt):
|
||||
if self.level:
|
||||
self.game.scenes.ingame(self.game,level = self.level)
|
||||
if not self.endcinematic:
|
||||
if self.level:
|
||||
self.game.globals["overworld"] = False
|
||||
self.game.scenes.ingame(self.game,level = self.level)
|
||||
else:
|
||||
self.game.globals["overworld"] = True
|
||||
self.game.scenes.overworld(self.game)
|
||||
else:
|
||||
self.game.scenes.overworld(self.game)
|
||||
self.game.scenes.end(self.game)
|
||||
|
||||
self.game.globals["pause"] = False
|
||||
|
||||
|
||||
|
@ -3,6 +3,7 @@ from gamedata.objects.ingame.tileset import TilesetRenderer
|
||||
from gamedata.objects.ingame.water import Water
|
||||
from gamedata.objects.results import Results
|
||||
from gamedata.objects.cinematic import Cinematic
|
||||
from gamedata.objects.endcinematic import EndCinematic
|
||||
|
||||
def ingame(game,level="Level 2"):
|
||||
game.globals["camerax"] = 0
|
||||
@ -26,3 +27,8 @@ def boot(game):
|
||||
game.scaleCamera(416,234)
|
||||
c = Cinematic(game)
|
||||
game.gameloop.summon(c)
|
||||
|
||||
def end(game):
|
||||
game.gameloop.reinit()
|
||||
c = EndCinematic(game)
|
||||
game.gameloop.summon(c)
|
||||
|