Skip to content

Commit

Permalink
Merge pull request #18 from LupaDevStudio/15-put-the-names-in-the-cre…
Browse files Browse the repository at this point in the history
…dits

15 put the names in the credits
  • Loading branch information
LupaDevStudio authored Nov 20, 2023
2 parents 918f75b + b6d08e2 commit 98a7bb8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
2 changes: 1 addition & 1 deletion resources/languages/french.json
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,6 @@
"game_over": {
"highscore": "Meilleur score : ",
"score": "Score : ",
"credits": "Jeu original développé par :\n\n- Paul Creusy\n-TODO\n\nRemasterisé par :\n\n- Paul Creusy\n- Agathe Aris"
"credits": "Jeu original développé par :\n\n- Paul Creusy\n- Clément Perrin\n- Balthazar Patiachvili\n- Alexis Guillon\n- Yohan Abehssera\n\nRemasterisé par :\n\n- Paul Creusy\n- Agathe Aris"
}
}
4 changes: 2 additions & 2 deletions screens/game.kv
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@
ImageWithTextButton:
id: decision_guillotine
source: PATH_IMAGES + "guillotine.png"
size_hint: None, 0.15
pos_hint: {"center_x": 0.5, "center_y": 0.1}
size_hint: None, 0.2
pos_hint: {"center_x": 0.5, "center_y": 0.12}
allow_stretch: True
keep_ratio: False
width: self.height
Expand Down
12 changes: 5 additions & 7 deletions screens/game_over.kv
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
id: score_label
text: root.score_text
source: PATH_IMAGES + "credits_background.png"
size_hint: 0.2, 0.15
pos_hint: {"center_x": 0.75, "center_y": 0.7}
size_hint: 0.25, 0.15
pos_hint: {"center_x": 0.8, "center_y": 0.7}
allow_stretch: True
keep_ratio:False
text_font_name: root.font_name
Expand All @@ -46,26 +46,24 @@
pos_hint: {"center_x": 0.75, "y": 0}
allow_stretch: True
keep_ratio:False


Label:
size_hint: 0.38, 0.3
size_hint: 0.38, 0.35
pos_hint: {"center_x": 0.75, "y": 0.02}
text: root.ending_text
font_name: root.font_name
color: TEXT_FONT_COLOR
text_size: self.size
halign: "center"
valign:"middle"
font_size: 12*root.font_ratio
font_size: 13*root.font_ratio


# Credit background
ImageWithText:
id: credits_label
text: root.credits_text
source: PATH_IMAGES + "credits_background.png"
size_hint: 0.3, 0.4
size_hint: 0.3, 0.5
pos_hint: {"center_x": 0.25, "center_y": 0.5}
allow_stretch: True
keep_ratio:False
Expand Down
23 changes: 18 additions & 5 deletions screens/game_over.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from kivy.properties import StringProperty, ObjectProperty, NumericProperty
from tools.kivy_tools import ImprovedScreen
from tools.path import (
PATH_TITLE_FONT,
PATH_IMAGES,
PATH_TEXT_FONT
)
Expand All @@ -31,25 +30,29 @@ class GameOverScreen(ImprovedScreen):

def __init__(self, **kw):
super().__init__(
# back_image_path=PATH_IMAGES + "game_over_background.png",
font_name=PATH_TEXT_FONT,
**kw)
self.credits_text = TEXT.game_over["credits"]
self.new_highscore: bool

def on_enter(self, *args):
# Play the game over music
music_mixer.play("time_of_the_apocalypse")

# Load the ending text
self.ending_text = game.ending_text

# Set the background
self.set_back_image_path(
PATH_IMAGES + "ending_" + game.ending + ".jpg")

if game.score > USER_DATA.highscore:
new_highscore = True
self.new_highscore = True
USER_DATA.highscore = game.score
else:
new_highscore = False
self.new_highscore = False

self.score_text = TEXT.game_over["score"] + str(game.score) + "\n" + \
self.score_text = TEXT.game_over["score"] + str(game.score) + "\n\n" + \
TEXT.game_over["highscore"] + str(USER_DATA.highscore)

if game.score == 0:
Expand All @@ -64,6 +67,16 @@ def on_enter(self, *args):
# Display something when getting a new highscore
return super().on_enter(*args)

def on_leave(self, *args):

# Unlock the end in the achievements menu
USER_DATA.endings[game.ending] = True

# Save the changes
USER_DATA.save_changes()

return super().on_leave(*args)

def back_to_menu(self):
"""
Go back to the main menu
Expand Down

0 comments on commit 98a7bb8

Please sign in to comment.