Skip to content
Snippets Groups Projects
Commit 79187622 authored by htoo-aung's avatar htoo-aung
Browse files

WIP piece select screen

parent 78231cb1
No related branches found
No related tags found
No related merge requests found
[gd_scene load_steps=3 format=3 uid="uid://0hpka0jh1qx4"]
[ext_resource type="PackedScene" uid="uid://bm8sv1itwm467" path="res://scenes/ui/menu_button.tscn" id="1_6pfss"]
[ext_resource type="Script" path="res://scripts/screens/select_piece_screen.gd" id="1_x5vw4"]
[node name="SelectPieceScreen" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_x5vw4")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -20.0
offset_top = 187.0
offset_right = 20.0
offset_bottom = 227.0
grow_horizontal = 2
[node name="StartButton" parent="." instance=ExtResource("1_6pfss")]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 509.0
offset_top = 462.5
offset_right = 509.0
offset_bottom = 462.5
grow_horizontal = 2
grow_vertical = 2
[connection signal="pressed" from="StartButton" to="." method="_on_start_pressed"]
[gd_scene load_steps=3 format=3 uid="uid://dogg5cp8c0f4s"]
[ext_resource type="Script" path="res://scripts/title_screen/title_screen.gd" id="1_kqy6i"]
[ext_resource type="PackedScene" uid="uid://bm8sv1itwm467" path="res://scenes/ui/menu_button.tscn" id="2_kj14e"]
[ext_resource type="Script" path="res://scripts/screens/title_screen.gd" id="1_655ci"]
[ext_resource type="PackedScene" uid="uid://bm8sv1itwm467" path="res://scenes/ui/menu_button.tscn" id="2_dljgh"]
[node name="TitleScreen" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_kqy6i")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_655ci")
[node name="RichTextLabel" type="RichTextLabel" parent="."]
layout_mode = 0
......@@ -24,21 +28,21 @@ anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 50.0
offset_top = 300.0
offset_top = 275.0
offset_right = 300.0
offset_bottom = 628.0
offset_bottom = 603.0
grow_vertical = 0
theme_override_constants/separation = 50
[node name="PlayButton" parent="MenuContainers" instance=ExtResource("2_kj14e")]
[node name="PlayButton" parent="MenuContainers" instance=ExtResource("2_dljgh")]
layout_mode = 2
size_flags_vertical = 3
[node name="RulesButton" parent="MenuContainers" instance=ExtResource("2_kj14e")]
[node name="RulesButton" parent="MenuContainers" instance=ExtResource("2_dljgh")]
layout_mode = 2
size_flags_vertical = 3
[node name="QuitButton" parent="MenuContainers" instance=ExtResource("2_kj14e")]
[node name="QuitButton" parent="MenuContainers" instance=ExtResource("2_dljgh")]
layout_mode = 2
size_flags_vertical = 3
......
[gd_scene load_steps=15 format=3 uid="uid://bm8sv1itwm467"]
[ext_resource type="Shader" path="res://assets/shaders/3d_effect.gdshader" id="1_loqws"]
[ext_resource type="Script" path="res://scripts/title_screen/menu_button.gd" id="1_mo82s"]
[ext_resource type="Script" path="res://scripts/screens/menu_button.gd" id="1_mo82s"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_no32e"]
......
......@@ -13,16 +13,13 @@ func reset_run() -> void:
currency = 0
enchantments.clear()
pieces.clear()
print("Run data reset")
func start_run():
reset_run()
scene_manager.change_scene("res://scenes/game.tscn")
func add_currency(piece: Node2D) -> void:
var piece_type = piece.get_class()
func add_currency(piece: Piece) -> void:
if piece is Pawn:
currency += 1
print(piece_type)
print()
print("Total currency: ", currency)
......@@ -5,7 +5,7 @@ var current_scene = null
@onready var fade_animation: AnimationPlayer = $CanvasLayer/AnimationPlayer
func _ready() -> void:
start_game("res://scenes/title_screen.tscn")
start_game("res://scenes/screens/title_screen.tscn")
# Initial start up scene for client, should be title screen
func start_game(scene_path: String) -> void:
......
extends Control
@onready var scene_manager: Node = $"../SceneManager"
@onready var start_button: TitleButton = $StartButton
func _ready() -> void:
# Temp image
start_button.set_image("res://assets/ui/title_screen/play_button.png")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_start_pressed() -> void:
RunData.start_run()
......@@ -15,7 +15,7 @@ func _process(delta: float) -> void:
pass
func _on_play_pressed() -> void:
RunData.start_run()
scene_manager.change_scene("res://scenes/screens/select_piece_screen.tscn")
func _on_quit_pressed() -> void:
get_tree().quit()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment