Last tweaks..

main
Olivier 'reivilibre' 2023-01-09 20:34:59 +00:00
parent 6c2c44a601
commit c0d2ef77cd
5 changed files with 33 additions and 2 deletions

View File

@ -74,3 +74,4 @@ texture = ExtResource( 3 )
num_days = 9
next_level = "Level0B"
needed_coins = 20
slug_chance_per_roll = 0.0

View File

@ -140,5 +140,7 @@ position = Vector2( 1320, 116 )
texture = ExtResource( 3 )
[node name="Hud" parent="." instance=ExtResource( 8 )]
next_level = "Level0B"
next_level = "Level0C"
slug_chance_per_roll = 0.4
slug_roll_rate = 6
max_slugs_per_group = 1

4
levels/Win.gd Normal file
View File

@ -0,0 +1,4 @@
extends Control
func _on_AgainBtn_pressed() -> void:
var _x := get_tree().change_scene("res://levels/Level0A.tscn")

24
levels/Win.tscn Normal file
View File

@ -0,0 +1,24 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://ui/normal_theme.tres" type="Theme" id=1]
[ext_resource path="res://levels/Win.gd" type="Script" id=2]
[ext_resource path="res://ui/thanks.png" type="Texture" id=3]
[node name="Win" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 3 )
centered = false
[node name="AgainBtn" type="Button" parent="."]
margin_left = 131.0
margin_top = 839.0
margin_right = 237.0
margin_bottom = 872.0
theme = ExtResource( 1 )
text = "Play again"
[connection signal="pressed" from="AgainBtn" to="." method="_on_AgainBtn_pressed"]

View File

@ -84,7 +84,7 @@ func _slug_spawner(parent: Node2D):
print("num rolls = ", num_rolls)
var interval = 1 / (DAY_PER_SEC * slug_roll_rate)
print("interval = ", interval)
for roll_num in range(num_rolls):
for _roll_num in range(num_rolls):
# wait for our next roll
timer.start(interval); yield(timer, "timeout")