the signals
This commit is contained in:
parent
4cde8ff47f
commit
1829102bb1
@ -149,7 +149,7 @@ uv2_triplanar_sharpness = 1.0
|
|||||||
proximity_fade_enable = true
|
proximity_fade_enable = true
|
||||||
proximity_fade_distance = 1.0
|
proximity_fade_distance = 1.0
|
||||||
distance_fade_enable = false
|
distance_fade_enable = false
|
||||||
_sections_unfolded = [ "Albedo", "Emission", "Metallic", "NormalMap", "Proximity Fade" ]
|
_sections_unfolded = [ "Albedo", "Emission", "Flags", "Metallic", "NormalMap", "Proximity Fade" ]
|
||||||
|
|
||||||
[sub_resource type="CubeMesh" id=4]
|
[sub_resource type="CubeMesh" id=4]
|
||||||
|
|
||||||
@ -332,7 +332,6 @@ _sections_unfolded = [ "Transform", "material" ]
|
|||||||
[node name="GridMap" type="GridMap" parent="Matrix" index="0"]
|
[node name="GridMap" type="GridMap" parent="Matrix" index="0"]
|
||||||
|
|
||||||
transform = Transform( 0.1, 0, 0, 0, 0.05, 0, 0, 0, 1, -0.45, -0.475, 0 )
|
transform = Transform( 0.1, 0, 0, 0, 0.05, 0, 0, 0, 1, -0.45, -0.475, 0 )
|
||||||
visible = false
|
|
||||||
theme = ExtResource( 3 )
|
theme = ExtResource( 3 )
|
||||||
cell_size = Vector3( 1, 1, 1 )
|
cell_size = Vector3( 1, 1, 1 )
|
||||||
cell_octant_size = 8
|
cell_octant_size = 8
|
||||||
@ -560,6 +559,8 @@ _sections_unfolded = [ "Margin", "custom_colors", "custom_fonts" ]
|
|||||||
|
|
||||||
[connection signal="animation_finished" from="FlashText/AnimationPlayer" to="FlashText" method="_on_AnimationPlayer_animation_finished"]
|
[connection signal="animation_finished" from="FlashText/AnimationPlayer" to="FlashText" method="_on_AnimationPlayer_animation_finished"]
|
||||||
|
|
||||||
|
[connection signal="flash_text" from="Stats" to="FlashText" method="print"]
|
||||||
|
|
||||||
[connection signal="level_up" from="Stats" to="." method="new_level"]
|
[connection signal="level_up" from="Stats" to="." method="new_level"]
|
||||||
|
|
||||||
[connection signal="start" from="Start" to="." method="new_game"]
|
[connection signal="start" from="Start" to="." method="new_game"]
|
||||||
|
@ -16,13 +16,12 @@ var score
|
|||||||
var high_score
|
var high_score
|
||||||
var time
|
var time
|
||||||
var combos
|
var combos
|
||||||
var flash_text
|
|
||||||
|
|
||||||
signal level_up(level)
|
signal level_up(level)
|
||||||
|
signal flash_text(text)
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
load_user_data()
|
load_user_data()
|
||||||
flash_text = get_node("../FlashText")
|
|
||||||
|
|
||||||
func load_user_data():
|
func load_user_data():
|
||||||
var save_game = File.new()
|
var save_game = File.new()
|
||||||
@ -49,7 +48,7 @@ func new_level():
|
|||||||
goal += 5 * level
|
goal += 5 * level
|
||||||
$VBC/Level.text = str(level)
|
$VBC/Level.text = str(level)
|
||||||
$VBC/Goal.text = str(goal)
|
$VBC/Goal.text = str(goal)
|
||||||
flash_text.print("Level\n%d"%level)
|
emit_signal("flash_text", "Level\n%d"%level)
|
||||||
emit_signal("level_up", level)
|
emit_signal("level_up", level)
|
||||||
|
|
||||||
func _on_Clock_timeout():
|
func _on_Clock_timeout():
|
||||||
@ -70,15 +69,15 @@ func piece_locked(lines, t_spin):
|
|||||||
var ds
|
var ds
|
||||||
if lines or t_spin:
|
if lines or t_spin:
|
||||||
if lines and t_spin:
|
if lines and t_spin:
|
||||||
flash_text.print(t_spin + " " + LINES_CLEARED_NAMES[lines])
|
emit_signal("flash_text", t_spin + " " + LINES_CLEARED_NAMES[lines])
|
||||||
elif lines:
|
elif lines:
|
||||||
flash_text.print(LINES_CLEARED_NAMES[lines])
|
emit_signal("flash_text", LINES_CLEARED_NAMES[lines])
|
||||||
elif t_spin:
|
elif t_spin:
|
||||||
flash_text.print(t_spin)
|
emit_signal("flash_text", t_spin)
|
||||||
goal -= SCORES[lines][""]
|
goal -= SCORES[lines][""]
|
||||||
$VBC/Goal.text = str(goal)
|
$VBC/Goal.text = str(goal)
|
||||||
ds = 100 * level * SCORES[lines][t_spin]
|
ds = 100 * level * SCORES[lines][t_spin]
|
||||||
flash_text.print(str(ds))
|
emit_signal("flash_text", str(ds))
|
||||||
score += ds
|
score += ds
|
||||||
$VBC/Score.text = str(score)
|
$VBC/Score.text = str(score)
|
||||||
if score > high_score:
|
if score > high_score:
|
||||||
@ -89,9 +88,9 @@ func piece_locked(lines, t_spin):
|
|||||||
combos += 1
|
combos += 1
|
||||||
if combos > 0:
|
if combos > 0:
|
||||||
if combos == 1:
|
if combos == 1:
|
||||||
flash_text.print("COMBO")
|
emit_signal("flash_text", "COMBO")
|
||||||
else:
|
else:
|
||||||
flash_text.print("COMBO x%d"%combos)
|
emit_signal("flash_text", "COMBO x%d"%combos)
|
||||||
ds = (20 if lines==1 else 50) * combos * level
|
ds = (20 if lines==1 else 50) * combos * level
|
||||||
emit_signal("flash_text", str(ds))
|
emit_signal("flash_text", str(ds))
|
||||||
score += ds
|
score += ds
|
||||||
|
Loading…
x
Reference in New Issue
Block a user