Add rotation change sound effect, add tutorial and also add it to README, fix window title, add statistics label, add custom difficulty

This commit is contained in:
2025-11-08 20:53:25 +01:00
parent 5973d1143f
commit d1b238b239
13 changed files with 146 additions and 17 deletions

37
menus/tutorial.py Normal file
View File

@@ -0,0 +1,37 @@
import arcade, arcade.gui
from utils.preload import button_texture, button_hovered_texture
from utils.constants import button_style
TUTORIAL_TEXT = """
In Connect the Current, you have to rotate power lines so power reaches to all of the houses.
- Every line has to be connected on all of it's sides.
- When needed, you might have to create loops of power or branches with no house linked to them.
(This is also because it's randomly generated and i couldn't find a way to generate maps with no meaningless branches)
- To rotate a line, just click on it and it will change its rotation.
- Maps are randomly generated, difficulty(size, source count, house count) depends on what you pick and grows exponentially.
"""
class Tutorial(arcade.gui.UIView):
def __init__(self, pypresence_client):
super().__init__()
self.pypresence_client = pypresence_client
self.pypresence_client.update(state="Checking Tutorial")
self.anchor = self.add_widget(arcade.gui.UIAnchorLayout(size_hint=(1, 1)))
self.box = self.anchor.add(arcade.gui.UIBoxLayout(space_between=20), anchor_x="center", anchor_y="top")
def main_exit(self):
from menus.main import Main
self.window.show_view(Main(self.pypresence_client))
def on_show_view(self):
super().on_show_view()
self.back_button = arcade.gui.UITextureButton(texture=button_texture, texture_hovered=button_hovered_texture, text='<--', style=button_style, width=100, height=50)
self.back_button.on_click = lambda event: self.main_exit()
self.anchor.add(self.back_button, anchor_x="left", anchor_y="top", align_x=5, align_y=-5)
self.box.add(arcade.gui.UILabel(text="CTC Tutorial", font_size=40))
self.box.add(arcade.gui.UILabel(text=TUTORIAL_TEXT, font_size=20, multiline=True))