rolls
This commit is contained in:
parent
5e1d105389
commit
8b9fc4a524
2 changed files with 55 additions and 3 deletions
|
@ -1,7 +1,47 @@
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://dk6bkpnylxwdb"]
|
[gd_scene load_steps=5 format=3 uid="uid://dk6bkpnylxwdb"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://n06gkookqeml" path="res://scenes/game/windows/Ads.tscn" id="1_n2kk4"]
|
[ext_resource type="PackedScene" uid="uid://n06gkookqeml" path="res://scenes/game/windows/Ads.tscn" id="1_n2kk4"]
|
||||||
[ext_resource type="Script" path="res://scripts/ads/ads_roll.gd" id="2_kihjv"]
|
[ext_resource type="Script" path="res://scripts/ads/ads_roll.gd" id="2_kihjv"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bbi7rhpstsku4" path="res://ressources/assets/RollDice/Dice.png" id="3_7himq"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://br2tesflbta84" path="res://ressources/assets/RollDice/ButtonDice.png" id="4_ldetv"]
|
||||||
|
|
||||||
[node name="Windows" instance=ExtResource("1_n2kk4")]
|
[node name="Windows" instance=ExtResource("1_n2kk4")]
|
||||||
script = ExtResource("2_kihjv")
|
script = ExtResource("2_kihjv")
|
||||||
|
|
||||||
|
[node name="Dice" type="Sprite2D" parent="." index="2"]
|
||||||
|
position = Vector2(251, 224.5)
|
||||||
|
scale = Vector2(0.401667, 0.351042)
|
||||||
|
texture = ExtResource("3_7himq")
|
||||||
|
|
||||||
|
[node name="Right" type="Label" parent="Dice" index="0"]
|
||||||
|
offset_left = 112.033
|
||||||
|
offset_top = 47.0029
|
||||||
|
offset_right = 319.033
|
||||||
|
offset_bottom = 249.003
|
||||||
|
theme_override_font_sizes/font_size = 142
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
|
||||||
|
[node name="Left" type="Label" parent="Dice" index="1"]
|
||||||
|
offset_left = -336.0
|
||||||
|
offset_top = 47.0
|
||||||
|
offset_right = -129.0
|
||||||
|
offset_bottom = 249.0
|
||||||
|
theme_override_font_sizes/font_size = 142
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
|
||||||
|
[node name="ButtonDice" type="Sprite2D" parent="." index="3"]
|
||||||
|
position = Vector2(252, 194)
|
||||||
|
scale = Vector2(0.4, 0.4)
|
||||||
|
texture = ExtResource("4_ldetv")
|
||||||
|
|
||||||
|
[node name="Button" type="Button" parent="ButtonDice" index="0"]
|
||||||
|
offset_left = -192.0
|
||||||
|
offset_top = -55.0
|
||||||
|
offset_right = 198.0
|
||||||
|
offset_bottom = 55.0
|
||||||
|
focus_mode = 0
|
||||||
|
flat = true
|
||||||
|
|
||||||
|
[connection signal="pressed" from="ButtonDice/Button" to="." method="_on_button_pressed"]
|
||||||
|
|
|
@ -1,9 +1,21 @@
|
||||||
extends "res://scripts/ads/ads_default.gd"
|
extends "res://scripts/ads/ads_default.gd"
|
||||||
|
|
||||||
# TODO
|
@onready var button := $ButtonDice/Button
|
||||||
|
@onready var label_left := $Dice/Left
|
||||||
|
@onready var label_right := $Dice/Right
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
pass
|
label_left.text = "0"
|
||||||
|
label_right.text = "0"
|
||||||
|
|
||||||
func exit_condition():
|
func exit_condition():
|
||||||
return condition
|
return condition
|
||||||
|
|
||||||
|
func _on_button_pressed():
|
||||||
|
var left := randi_range(0, 6)
|
||||||
|
var right := randi_range(0, 6)
|
||||||
|
|
||||||
|
label_left.text = str(left)
|
||||||
|
label_right.text = str(right)
|
||||||
|
|
||||||
|
condition = left + right >= 5
|
||||||
|
|
Reference in a new issue