Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions enums.gd
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
extends Node

const APP_VER:String = "0.1.0"
const APP_BLD:String = "2040510"
const APP_BLD:String = "20240510"
const TWEEN_TIME:float = 0.25
const EXPLODE_DELAY:int = 1
var current_debug_level = DEBUG_LEVEL.DEBUG # Global variable to set the current debug level
const SRPITE_POS:Vector2 = Vector2(64,64)
var current_debug_level = DEBUG_LEVEL.INFO # Global variable to set the current debug level

# =========================================================

enum GemColor {
WHITE,
RED,
YELLOW,
BROWN,
GREEN,
PURPLE
PURPLE,
BROWN
}

func get_color_name_by_value(value: int) -> String:
Expand Down
29 changes: 0 additions & 29 deletions game.gd

This file was deleted.

53 changes: 53 additions & 0 deletions game/animated_cloud.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[gd_scene load_steps=5 format=3 uid="uid://d0yw6oyw3qib0"]

[ext_resource type="Texture2D" uid="uid://cnlqirgwr8d4" path="res://assets/bkgd/Background.png" id="1_p4wo5"]
[ext_resource type="Texture2D" uid="uid://cfdjrsigqjjjk" path="res://assets/bkgd/Cloud_2.png" id="2_vo0va"]

[sub_resource type="Animation" id="Animation_0x8pj"]
resource_name = "move_cloud"
length = 30.0
loop_mode = 2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 30),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(64, 220), Vector2(1936, 220)]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_5m8mq"]
_data = {
"move_cloud": SubResource("Animation_0x8pj")
}

[node name="AnimatedCloud" type="Node2D"]

[node name="Debug-Background" type="TextureRect" parent="."]
visible = false
offset_right = 2000.0
offset_bottom = 1390.0
texture = ExtResource("1_p4wo5")
expand_mode = 2

[node name="Debug-Panel" type="Panel" parent="."]
visible = false
anchors_preset = 10
anchor_right = 1.0
offset_right = 2000.0
offset_bottom = 150.0
grow_horizontal = 2

[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(64, 220)
texture = ExtResource("2_vo0va")

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_5m8mq")
}
autoplay = "move_cloud"
35 changes: 35 additions & 0 deletions game/game.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
extends Node2D
# SCENES
@onready var game_board:GameBoard = $Board
@onready var game_stats:VBoxContainer = $GameStats
@onready var game_top_h_box:HBoxContainer = $GameTopHBox

func _ready():
game_board.connect("props_updated_moves", self._on_props_updated_moves)
game_board.connect("props_updated_score", self._on_props_updated_score)
game_board.connect("props_updated_gemsdict", self._on_props_updated_gemsdict)

func _on_props_updated_gemsdict(gems_dict:Dictionary):
# EX: `{ "WHITE": 9, "RED": 11, "YELLOW": 14, "BROWN": 9, "GREEN": 9, "PURPLE": 12 }`
game_stats.get_child(0).get_child(1).text = str(gems_dict["WHITE"])
game_stats.get_child(1).get_child(1).text = str(gems_dict["RED"])
game_stats.get_child(2).get_child(1).text = str(gems_dict["YELLOW"])
game_stats.get_child(3).get_child(1).text = str(gems_dict["GREEN"])
game_stats.get_child(4).get_child(1).text = str(gems_dict["PURPLE"])
game_stats.get_child(5).get_child(1).text = str(gems_dict["BROWN"])

func _on_props_updated_score(score:int):
game_top_h_box.get_child(0).get_child(1).text = str(score)

func _on_props_updated_moves(moves:int):
game_top_h_box.get_child(1).get_child(1).text = str(moves)

func _on_newgame_button_pressed():
game_board.new_game()

func _on_btn_clear_debug_labels_pressed():
game_board.debug_clear_debug_labels()

func _on_btn_make_vert_pressed():
game_board.debug_make_gem_grid()
#game_board.debug_make_match_col()
Loading