- Gui Improvement

- ground improvement for future bioms
- first sounds
This commit is contained in:
megamichi 2024-10-07 17:02:32 +02:00
parent 9b8f4db275
commit 2f0e5a59d9
15 changed files with 165 additions and 157 deletions

View file

@ -12,12 +12,15 @@ func _process(_delta: float) -> void:
func _on_duck_gameover() -> void:
$AnimationPlayer.play_backwards("out-in")
$"../../Audio/GameOver".play()
$"../../Audio/Gui-in".play()
show()
func _on_restart_pressed() -> void:
$"../..".start_game()
$AnimationPlayer.play("out-in")
$"../../Audio/Gui-out".play()
await $AnimationPlayer.animation_finished
hide()

View file

@ -13,9 +13,11 @@ func _process(_delta: float) -> void:
func open():
show()
$AnimationPlayer.play_backwards("out-in")
$"../../Audio/Gui-in".play()
func _on_back_pressed() -> void:
$AnimationPlayer.play("out-in")
$"../../Audio/Gui-out".play()
await $AnimationPlayer.animation_finished
hide()
$"../StartSchild"._ready()

View file

@ -4,22 +4,24 @@ extends TextureRect
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
$AnimationPlayer.play_backwards("out-in")
$"../../Audio/Gui-in".play()
show()
func _process(_delta: float) -> void:
global_position.x = get_viewport().get_visible_rect().size.x -100
$Logo.global_position.x = 0
func _process(delta: float) -> void:
$Logo.global_position.x = -5
func _on_start_pressed() -> void:
$"../..".start_game()
$AnimationPlayer.play("out-in")
$"../../Audio/Gui-out".play()
await $AnimationPlayer.animation_finished
hide()
func _on_settings_pressed() -> void:
$AnimationPlayer.play("out-in")
$"../../Audio/Gui-out".play()
await $AnimationPlayer.animation_finished
hide()
$"../Settings".open()

View file

@ -1,10 +0,0 @@
extends Node
signal levelup
signal start
var maxspeed = 260
var speed = 100
var score = 0
var gamerunning = false

View file

@ -30,8 +30,14 @@ func _score() -> void:
func _process(delta):
if $"/root/Global".gamerunning:
$Screen/Background/Sprites.position.x -= $"/root/Global".speed*delta
if $Screen/Background/Sprites.position.x <= -200:
$Screen/Background/Sprites.position.x = 0
var background_size_x = $Screen/Background/Sprite.texture.get_size().x
var bla = (background_size_x) + $Screen/Background/Sprite.position.x
print(background_size_x)
print(bla)
if $"/root/Global".gamerunning:
$Screen/Background/Sprite.position.x -= $"/root/Global".speed*delta
if bla <= 0:
$Screen/Background/Sprite.position.x = 0