Skip to content

Commit 98ef0d2

Browse files
committed
reduced EXPLODE_DELAY
1 parent 1a93c3d commit 98ef0d2

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

enums.gd

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

3-
const APP_VER:String = "0.1.0"
4-
const APP_BLD:String = "20240510"
3+
const APP_VER:String = "0.3.0"
4+
const APP_BLD:String = "20240511"
55
const TWEEN_TIME:float = 0.25
6-
const EXPLODE_DELAY:int = 1
6+
const EXPLODE_DELAY:float = TWEEN_TIME*2.0
77
const SRPITE_POS:Vector2 = Vector2(64,64)
88
var current_debug_level = DEBUG_LEVEL.DEBUG # Global variable to set the current debug level
99

game_board/GameBoard.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ func explode_refill_gems(gem_cells: Array):
358358
signal_game_props_count_gems()
359359

360360
# B: let explode animation run
361-
await get_tree().create_timer(Enums.EXPLODE_DELAY).timeout
361+
await get_tree().create_timer(Enums.TWEEN_TIME).timeout
362362

363363
# C: Dictionary to track columns and the number of gems to add in each column
364364
var columns_to_refill = {}

game_board/GemCell.gd

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,10 @@ func replace_gem(colorIn: Enums.GemColor, rows_to_drop: int = 1):
6060
call_deferred("drop_in_gem", drop_height)
6161

6262
func drop_in_gem(drop_height: float):
63-
const DROP_TIME = Enums.TWEEN_TIME #* 2
64-
#await get_tree().create_timer(DROP_TIME).timeout
65-
6663
# Tween the "fall" animation from the starting point to the final position
6764
var end_pos = Vector2(sprite.position.x, sprite.position.y + drop_height)
6865
var tween = get_tree().create_tween()
69-
tween.tween_property(sprite, "position", end_pos, DROP_TIME)
66+
tween.tween_property(sprite, "position", end_pos, Enums.TWEEN_TIME)
7067

7168
func update_texture():
7269
if gem_color in gem_textures:
@@ -98,15 +95,15 @@ func play_anim_explode():
9895
anim_player_fx.stop()
9996
sprite.visible = false
10097

98+
# D: show points
99+
anim_player_fx.play("new_points")
100+
101101
# C: explode animation (exploding sprite)
102102
anim_sprite_explode.visible = true
103103
anim_sprite_explode.play("default")
104104
await get_tree().create_timer(Enums.EXPLODE_DELAY).timeout
105+
print(Enums.EXPLODE_DELAY)
105106
anim_sprite_explode.visible = false
106-
107-
# D: show points
108-
anim_player_fx.play("new_points")
109-
110107

111108
# =========================================================
112109

game_board/gem_cell.tscn

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ bg_color = Color(0, 0, 0, 0.533333)
1515

1616
[sub_resource type="Animation" id="Animation_3mn62"]
1717
resource_name = "explode"
18+
length = 0.5
1819
tracks/0/type = "value"
1920
tracks/0/imported = false
2021
tracks/0/enabled = true
2122
tracks/0/path = NodePath("Sprite2D:scale")
2223
tracks/0/interp = 1
2324
tracks/0/loop_wrap = true
2425
tracks/0/keys = {
25-
"times": PackedFloat32Array(0, 1),
26+
"times": PackedFloat32Array(0, 0.5),
2627
"transitions": PackedFloat32Array(1, 1),
2728
"update": 0,
2829
"values": [Vector2(0.5, 0.5), Vector2(0, 0)]
@@ -203,7 +204,7 @@ animations = [{
203204
}],
204205
"loop": false,
205206
"name": &"default",
206-
"speed": 12.0
207+
"speed": 24.0
207208
}]
208209

209210
[node name="GemCell" type="Control"]
@@ -244,11 +245,12 @@ libraries = {
244245
}
245246

246247
[node name="AnimSpriteExplode" type="AnimatedSprite2D" parent="."]
247-
visible = false
248248
position = Vector2(65, 64)
249249
scale = Vector2(3.5, 3.5)
250250
sprite_frames = SubResource("SpriteFrames_tvpu7")
251251
autoplay = "default"
252+
frame = 11
253+
frame_progress = 1.0
252254

253255
[node name="DebugLabelSelNum" type="Label" parent="."]
254256
visible = false

0 commit comments

Comments
 (0)