Skip to content

Commit a031597

Browse files
authored
Merge pull request #4 from gitbrent/resize-display
Resize display
2 parents 4bb9403 + 338fb62 commit a031597

15 files changed

+348
-160
lines changed

enums.gd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
extends Node
22

33
const APP_VER:String = "0.1.0"
4-
const APP_BLD:String = "2040510"
4+
const APP_BLD:String = "20240510"
55
const TWEEN_TIME:float = 0.25
66
const EXPLODE_DELAY:int = 1
7+
const SRPITE_POS:Vector2 = Vector2(64,64)
78
var current_debug_level = DEBUG_LEVEL.INFO # Global variable to set the current debug level
89

910
# =========================================================
@@ -12,9 +13,9 @@ enum GemColor {
1213
WHITE,
1314
RED,
1415
YELLOW,
15-
BROWN,
1616
GREEN,
17-
PURPLE
17+
PURPLE,
18+
BROWN
1819
}
1920

2021
func get_color_name_by_value(value: int) -> String:

game.gd

Lines changed: 0 additions & 29 deletions
This file was deleted.

game/animated_cloud.tscn

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[gd_scene load_steps=5 format=3 uid="uid://d0yw6oyw3qib0"]
2+
3+
[ext_resource type="Texture2D" uid="uid://cnlqirgwr8d4" path="res://assets/bkgd/Background.png" id="1_p4wo5"]
4+
[ext_resource type="Texture2D" uid="uid://cfdjrsigqjjjk" path="res://assets/bkgd/Cloud_2.png" id="2_vo0va"]
5+
6+
[sub_resource type="Animation" id="Animation_0x8pj"]
7+
resource_name = "move_cloud"
8+
length = 30.0
9+
loop_mode = 2
10+
tracks/0/type = "value"
11+
tracks/0/imported = false
12+
tracks/0/enabled = true
13+
tracks/0/path = NodePath("Sprite2D:position")
14+
tracks/0/interp = 1
15+
tracks/0/loop_wrap = true
16+
tracks/0/keys = {
17+
"times": PackedFloat32Array(0, 30),
18+
"transitions": PackedFloat32Array(1, 1),
19+
"update": 0,
20+
"values": [Vector2(64, 220), Vector2(1936, 220)]
21+
}
22+
23+
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5m8mq"]
24+
_data = {
25+
"move_cloud": SubResource("Animation_0x8pj")
26+
}
27+
28+
[node name="AnimatedCloud" type="Node2D"]
29+
30+
[node name="Debug-Background" type="TextureRect" parent="."]
31+
visible = false
32+
offset_right = 2000.0
33+
offset_bottom = 1390.0
34+
texture = ExtResource("1_p4wo5")
35+
expand_mode = 2
36+
37+
[node name="Debug-Panel" type="Panel" parent="."]
38+
visible = false
39+
anchors_preset = 10
40+
anchor_right = 1.0
41+
offset_right = 2000.0
42+
offset_bottom = 150.0
43+
grow_horizontal = 2
44+
45+
[node name="Sprite2D" type="Sprite2D" parent="."]
46+
position = Vector2(64, 220)
47+
texture = ExtResource("2_vo0va")
48+
49+
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
50+
libraries = {
51+
"": SubResource("AnimationLibrary_5m8mq")
52+
}
53+
autoplay = "move_cloud"

game/game.gd

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
extends Node2D
2+
# SCENES
3+
@onready var game_board:GameBoard = $Board
4+
@onready var game_stats:VBoxContainer = $GameStats
5+
@onready var game_top_h_box:HBoxContainer = $GameTopHBox
6+
7+
func _ready():
8+
game_board.connect("props_updated_moves", self._on_props_updated_moves)
9+
game_board.connect("props_updated_score", self._on_props_updated_score)
10+
game_board.connect("props_updated_gemsdict", self._on_props_updated_gemsdict)
11+
12+
func _on_props_updated_gemsdict(gems_dict:Dictionary):
13+
# EX: `{ "WHITE": 9, "RED": 11, "YELLOW": 14, "BROWN": 9, "GREEN": 9, "PURPLE": 12 }`
14+
game_stats.get_child(0).get_child(1).text = str(gems_dict["WHITE"])
15+
game_stats.get_child(1).get_child(1).text = str(gems_dict["RED"])
16+
game_stats.get_child(2).get_child(1).text = str(gems_dict["YELLOW"])
17+
game_stats.get_child(3).get_child(1).text = str(gems_dict["GREEN"])
18+
game_stats.get_child(4).get_child(1).text = str(gems_dict["PURPLE"])
19+
game_stats.get_child(5).get_child(1).text = str(gems_dict["BROWN"])
20+
21+
func _on_props_updated_score(score:int):
22+
game_top_h_box.get_child(0).get_child(1).text = str(score)
23+
24+
func _on_props_updated_moves(moves:int):
25+
game_top_h_box.get_child(1).get_child(1).text = str(moves)
26+
27+
func _on_newgame_button_pressed():
28+
game_board.new_game()
29+
30+
func _on_btn_clear_debug_labels_pressed():
31+
game_board.debug_clear_debug_labels()
32+
33+
func _on_btn_make_vert_pressed():
34+
game_board.debug_make_gem_grid()
35+
#game_board.debug_make_match_col()

0 commit comments

Comments
 (0)