Updated game over screen

This commit is contained in:
theo@manjaro 2021-09-19 16:58:39 +02:00
parent aa631c188e
commit 706b7e0d92
15 changed files with 35 additions and 2 deletions

View File

@ -1,12 +1,12 @@
# Textures # Textures
All the textures are edited by myself to fit the [Famicube palette](https://lospec.com/palette-list/famicube) I edited some textures to fit the [Famicube palette](https://lospec.com/palette-list/famicube)
## Tileset ## Tileset
[Buch - OpenGameArt](https://opengameart.org/content/the-field-of-the-floating-islands) [Buch - OpenGameArt](https://opengameart.org/content/the-field-of-the-floating-islands)
## Little characters ## "Pinmik" sprite ( I made the recolors )
[GraphxKid - OpenGameArt](https://opengameart.org/content/arcade-platformer-assets) [GraphxKid - OpenGameArt](https://opengameart.org/content/arcade-platformer-assets)
@ -21,3 +21,7 @@ All the textures are edited by myself to fit the [Famicube palette](https://losp
## Font ## Font
[Front End Dev - Grape Soda](https://fontenddev.com/fonts/grape-soda/) [Front End Dev - Grape Soda](https://fontenddev.com/fonts/grape-soda/)
## Dust particles
[GraphxKid - OpenGameArt](https://opengameart.org/content/items-and-elements)

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

View File

@ -1,6 +1,8 @@
from gamedata.objects.base import BaseObject from gamedata.objects.base import BaseObject
from gamedata.objects.button import Button from gamedata.objects.button import Button
import random
class GameOver(BaseObject): class GameOver(BaseObject):
def __init__(self,game): def __init__(self,game):
super().__init__(0,0,game) super().__init__(0,0,game)
@ -14,6 +16,8 @@ class GameOver(BaseObject):
btn.click = fnBack btn.click = fnBack
game.gameloop.summon(btn) game.gameloop.summon(btn)
self.depth = -1
# Updating highscore # Updating highscore
self.highscore = False self.highscore = False
self.newunlocks = [] self.newunlocks = []
@ -70,6 +74,28 @@ class GameOver(BaseObject):
# Launch particles # Launch particles
self.launched = True self.launched = True
if self.highscore: # Balloons
offy = self.game.DISPLAY_HEIGHT+40
for i in range(2):
for direction in [-1,1]:
for color in ["yellow","red","blue"]:
sprite = [self.game.sprite_lib["particles/balloons/"+color+".png"]]
offx = self.game.DISPLAY_WIDTH/2-direction*self.game.DISPLAY_WIDTH/2*1.2
velx = (random.random()*3+1+2*i)*direction/2
vely = (random.random()+2)*-1
self.game.addParticle(sprite,offx,offy,velx=velx,vely=vely,flipx=direction==-1,fps=0.3)
# Confettis
for j in range(30):
for i in range(8):
color = random.choice(["red","blue","yellow"])
sprites = self.game.getSpriteDir("particles/confetti/"+color+"/")
offx = random.randint(0,self.game.DISPLAY_WIDTH)
offy = -40*i
velx = random.random()*2-1
vely = random.random()*5+2
self.game.addParticle(sprites,offx,offy,velx=velx,vely=vely,flipx=random.randint(0,1),fps=2)
if self.launched: if self.launched:
self.flashtimer.tick(self.game.dt) self.flashtimer.tick(self.game.dt)
@ -78,6 +104,9 @@ class GameOver(BaseObject):
self.displayscore = int(self.game.globals["score"]) self.displayscore = int(self.game.globals["score"])
def draw(self): def draw(self):
# Display night sky
self.game.window.blit(self.game.pygame.transform.scale(self.game.sprite_lib["skies/night.png"],[self.game.DISPLAY_WIDTH,self.game.DISPLAY_HEIGHT]),[0,0])
self.game.window.blit(self.game.sprite_lib["vignette.png"],[0,0])
# Display score # Display score
txt = self.game.fontfilebig.render("Score : "+str(int(self.displayscore)),False,self.color) txt = self.game.fontfilebig.render("Score : "+str(int(self.displayscore)),False,self.color)
txt = self.game.pygame.transform.scale(txt,(round(txt.get_width()*self.scale),round(txt.get_height()*self.scale))) txt = self.game.pygame.transform.scale(txt,(round(txt.get_width()*self.scale),round(txt.get_height()*self.scale)))