added animations and changed lives

This commit is contained in:
Tabby 2025-06-18 23:45:56 +10:00
parent d811193b25
commit 3774220102
2 changed files with 21 additions and 11 deletions

View file

@ -16,6 +16,8 @@ extends Node2D
@export var sound_player : AudioStreamPlayer
@export var finish_screen : Control
@export var sam_sprite : AnimatedSprite2D
@export var rock_sprite : AnimatedSprite2D
@export var statue_sprite : AnimatedSprite2D
var current_time : float = 5
var score : int = 0
var lives : int = 3
@ -97,6 +99,7 @@ func start_round():
sound_player.stream = sounds["reveal"]
sound_player.play()
sam_sprite.play("default")
rock_sprite.play("crack")
#scroll_container.scroll_horizontal = 0
pass
@ -126,6 +129,9 @@ func process_input(direction : int):
func win_round():
#todo: bous for remaining time?
sam_sprite.play("bow")
rock_sprite.play("fall")
statue_sprite.show()
statue_sprite.frame += 1
sound_player.stream = sounds["roundSuccess"]
sound_player.play()
gaming = false
@ -141,6 +147,8 @@ func win_round():
score += 100
func lose_round():
statue_sprite.hide()
rock_sprite.play("fall")
gaming = false
sam_sprite.play("tan")
codepos = 0