- Gui Improvement
- ground improvement for future bioms - first sounds
This commit is contained in:
parent
9b8f4db275
commit
2f0e5a59d9
15 changed files with 165 additions and 157 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
extends Node
|
||||
|
||||
|
||||
signal levelup
|
||||
signal start
|
||||
|
||||
var maxspeed = 260
|
||||
var speed = 100
|
||||
var score = 0
|
||||
var gamerunning = false
|
14
code/main.gd
14
code/main.gd
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue