parent
e0cb4ec2bf
commit
cdff133584
18
game.gd
18
game.gd
|
@ -75,14 +75,16 @@ func _check_win() -> String:
|
|||
#Generiert die Zufallszahl von 1-6
|
||||
func _roll_dice():
|
||||
var zahl = randi() % 6 + 1
|
||||
_update_dice_sprite(randi() % 6 + 1)
|
||||
await get_tree().create_timer(0.3).timeout
|
||||
_update_dice_sprite(randi() % 6 + 1)
|
||||
await get_tree().create_timer(0.3).timeout
|
||||
_update_dice_sprite(randi() % 6 + 1)
|
||||
await get_tree().create_timer(0.3).timeout
|
||||
_update_dice_sprite(randi() % 6 + 1)
|
||||
await get_tree().create_timer(0.3).timeout
|
||||
var animation_help
|
||||
var zahl_davor
|
||||
for i in range(6):
|
||||
if animation_help == zahl_davor:
|
||||
zahl_davor = randi() % 6 + 1
|
||||
_update_dice_sprite(zahl_davor)
|
||||
animation_help = zahl_davor
|
||||
|
||||
await get_tree().create_timer(0.25).timeout
|
||||
|
||||
_update_dice_sprite(zahl)
|
||||
print(zahl) #Debug ausgabe, später löschen lol
|
||||
return zahl
|
||||
|
|
Loading…
Reference in New Issue