Added dice
This commit is contained in:
@@ -59,7 +59,7 @@ animations = [{
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 0.4,
|
||||
"duration": 1.9,
|
||||
"texture": ExtResource("1_288jf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
@@ -84,8 +84,8 @@ animations = [{
|
||||
|
||||
[node name="Dice" type="Node2D" unique_id=668450548]
|
||||
script = ExtResource("1_x6ve6")
|
||||
roll_time = null
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=78541616]
|
||||
sprite_frames = SubResource("SpriteFrames_yynlm")
|
||||
animation = &"6"
|
||||
animation = &"rolling"
|
||||
frame_progress = 0.8785853
|
||||
|
||||
@@ -13,10 +13,9 @@ func roll_dice():
|
||||
if is_rolling:
|
||||
return
|
||||
is_rolling = true
|
||||
sprite.play('rolling')
|
||||
await get_tree().create_timer(roll_time).timeout
|
||||
|
||||
self.random_value = int(randi_range(0, 7))
|
||||
self.random_value = randi_range(1, 6)
|
||||
sprite.play(str(self.random_value))
|
||||
is_rolling = false
|
||||
|
||||
func _process(delta):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user