Skip to content

Commit

Permalink
Start the tutorial for the first launch of the game
Browse files Browse the repository at this point in the history
  • Loading branch information
LupaDevStudio committed Nov 27, 2023
1 parent 732ccf4 commit 9b1c0a1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
Binary file removed resources/images/game_over_background.png
Binary file not shown.
2 changes: 1 addition & 1 deletion screens/menu.kv
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
pos_hint: {"center_x": 0.5, "center_y": 0.45}
background_color: 0, 0, 0, 0
on_release:
root.manager.current = "game"
root.start_game()

Image:
id: settings_logo
Expand Down
25 changes: 21 additions & 4 deletions screens/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@


from kivy.clock import Clock
from kivy.properties import (
BooleanProperty
)

from tools.path import (
PATH_IMAGES,
PATH_TITLE_FONT
)
from tools.constants import (
FPS,
USER_DATA
)
from tools.kivy_tools import (
ImprovedScreen
)
from tools.kivy_tools import ImprovedScreen
from tools import (
music_mixer
)
Expand Down Expand Up @@ -59,3 +59,20 @@ def update(self, *args):
self.ids.start_label.opacity += self.opacity_state * self.opacity_rate
if self.ids.start_label.opacity < 0 or self.ids.start_label.opacity > 1:
self.opacity_state = -self.opacity_state

def start_game(self):
"""
Start the tutorial for the first time, otherwise the game.
Parameters
----------
None
Returns
-------
None
"""
if USER_DATA.tutorial:
self.manager.current = "tutorial"
else:
self.manager.current = "game"

0 comments on commit 9b1c0a1

Please sign in to comment.