File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -60,3 +60,8 @@ margin_left = 20.0
6060margin_top = 20.0
6161margin_right = 1840.0
6262margin_bottom = 914.0
63+
64+ [node name ="Timer" type ="Timer" parent ="." ]
65+ one_shot = true
66+ autostart = true
67+ [connection signal ="timeout" from ="Timer" to ="PlayingScreen" method ="_on_Timer_timeout" ]
Original file line number Diff line number Diff line change 11extends VBoxContainer
22
3+ var start_time = - 1
4+
35func _ready ():
6+ var label = Label .new ()
7+ label .text = "ready..."
8+ label .align = Label .ALIGN_CENTER
9+ label .set_anchors_preset (Control .PRESET_HCENTER_WIDE )
10+ $ DisplayBorder/Display .add_child (label )
411 $ HUDBorder/HUD/Level .text = scene .get_param ("level" )
12+ match scene .get_param ("level" ):
13+ "BUBBLE SORT" :
14+ pass
15+
16+ func _process (delta ):
17+ var elapsed_time = stepify ((OS .get_ticks_msec () - start_time ) / 1000.0 , 0.001 )
18+ $ HUDBorder/HUD/Score .text = "0.000" if start_time == - 1 else "%.3f " % elapsed_time
519
6- # Called every frame. 'delta' is the elapsed time since the previous frame.
7- # func _process(delta):
8- # pass
20+ func _on_Timer_timeout ():
21+ $ DisplayBorder/Display . get_child ( 0 ). queue_free ()
22+ start_time = OS . get_ticks_msec ()
You can’t perform that action at this time.
0 commit comments