diff --git a/assets/GUI/back button.png b/assets/GUI/back button.png index aa50732..85c3d04 100644 Binary files a/assets/GUI/back button.png and b/assets/GUI/back button.png differ diff --git a/assets/GUI/buttons fucused/back button f.png b/assets/GUI/buttons fucused/back button f.png index 5b7a704..31ccef6 100644 Binary files a/assets/GUI/buttons fucused/back button f.png and b/assets/GUI/buttons fucused/back button f.png differ diff --git a/assets/GUI/buttons fucused/note button f.png b/assets/GUI/buttons fucused/note button f.png index c9bfbdf..3dbe3c9 100644 Binary files a/assets/GUI/buttons fucused/note button f.png and b/assets/GUI/buttons fucused/note button f.png differ diff --git a/assets/GUI/buttons fucused/restart button f.png b/assets/GUI/buttons fucused/restart button f.png index cb9452a..498b6e7 100644 Binary files a/assets/GUI/buttons fucused/restart button f.png and b/assets/GUI/buttons fucused/restart button f.png differ diff --git a/assets/GUI/buttons fucused/settings button f.png b/assets/GUI/buttons fucused/settings button f.png index 56b25b5..592330b 100644 Binary files a/assets/GUI/buttons fucused/settings button f.png and b/assets/GUI/buttons fucused/settings button f.png differ diff --git a/assets/GUI/buttons fucused/sound button f.png b/assets/GUI/buttons fucused/sound button f.png index ea737a7..d915732 100644 Binary files a/assets/GUI/buttons fucused/sound button f.png and b/assets/GUI/buttons fucused/sound button f.png differ diff --git a/assets/GUI/buttons fucused/sound button off f.png b/assets/GUI/buttons fucused/sound button off f.png index f8f9af8..d0ec8b7 100644 Binary files a/assets/GUI/buttons fucused/sound button off f.png and b/assets/GUI/buttons fucused/sound button off f.png differ diff --git a/assets/GUI/buttons fucused/start button f.png b/assets/GUI/buttons fucused/start button f.png index 9f73d0d..e1f0d5c 100644 Binary files a/assets/GUI/buttons fucused/start button f.png and b/assets/GUI/buttons fucused/start button f.png differ diff --git a/assets/GUI/start button.png b/assets/GUI/start button.png index 2041467..b63b13a 100644 Binary files a/assets/GUI/start button.png and b/assets/GUI/start button.png differ diff --git a/code/GUI/restartschild.gd b/code/GUI/restartschild.gd index 8ef64b5..ae3ee62 100644 --- a/code/GUI/restartschild.gd +++ b/code/GUI/restartschild.gd @@ -1,33 +1,22 @@ extends TextureRect -# Called when the node enters the scene tree for the first time. func _ready() -> void: $AnimationPlayer.play_backwards("out-in") hide() - -func _process(_delta: float) -> void: - pass - #global_position.x = get_viewport().get_visible_rect().size.x * 0.5 + func _on_duck_gameover() -> void: - $AnimationPlayer.play_backwards("out-in") + $AnimationPlayer.pop_in() $"../../Audio/GameOver".play() - $"../../Audio/Gui-in".play() - show() $Restart.grab_focus() print($"/root/Global".hiscore) if %ScoreContainer.get_score() > $"/root/Global".hiscore: $"/root/Global".write_save() - - func _on_restart_pressed() -> void: $"../..".start_game() - $AnimationPlayer.play("out-in") - $"../../Audio/Gui-out".play() - await $AnimationPlayer.animation_finished - hide() + $AnimationPlayer.pop_out() func _on_back_pressed() -> void: diff --git a/code/GUI/settingsschild.gd b/code/GUI/settingsschild.gd index db29900..4f12069 100644 --- a/code/GUI/settingsschild.gd +++ b/code/GUI/settingsschild.gd @@ -5,7 +5,7 @@ var audio_bus_sounds = 2 var sound_button_on_of = {true:preload("res://assets/GUI/sound button.png"),false:preload("res://assets/GUI/sound button off.png")} var sound_button_on_of_f = {true:preload("res://assets/GUI/buttons fucused/sound button f.png"),false:preload("res://assets/GUI/buttons fucused/sound button off f.png")} -# Called when the node enters the scene tree for the first time. + func _ready() -> void: #$"../../Audio/Duckrun".volume_db = linear_to_db(20*0.01) $AnimationPlayer.play_backwards("out-in") @@ -16,25 +16,18 @@ func _process(_delta: float) -> void: #$Logo.global_position.x = 0 func open(): - show() - $AnimationPlayer.play_backwards("out-in") - $"../../Audio/Gui-in".play() + $AnimationPlayer.pop_in() $BackButton.grab_focus() func _on_back_pressed() -> void: - $AnimationPlayer.play("out-in") - $"../../Audio/Gui-out".play() - await $AnimationPlayer.animation_finished - hide() + $AnimationPlayer.pop_out() $"../StartSchild"._ready() - - func _volume_slider_changed(value: float) -> void: AudioServer.set_bus_volume_db(audio_bus_music,linear_to_db(value*0.01)) -func _on_sound_button_toggled(toggled_on: bool) -> void: +func _on_sound_button_toggled(_toggled_on: bool) -> void: $SoundToggleButton.texture_normal = sound_button_on_of[AudioServer.is_bus_mute(audio_bus_sounds)] $SoundToggleButton.texture_focused = sound_button_on_of_f[AudioServer.is_bus_mute(audio_bus_sounds)] AudioServer.set_bus_mute(audio_bus_sounds,not AudioServer.is_bus_mute(audio_bus_sounds)) diff --git a/code/GUI/startschild.gd b/code/GUI/startschild.gd index 1d53da3..2831b50 100644 --- a/code/GUI/startschild.gd +++ b/code/GUI/startschild.gd @@ -1,28 +1,21 @@ 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() + $"../StartSchildLogo/AnimationPlayer".pop_in() + $AnimationPlayer.pop_in() $Start.grab_focus() - -func _process(delta: float) -> void: - $Logo.global_position.x = -5 func _on_start_pressed() -> void: + $AnimationPlayer.pop_out() + $"../StartSchildLogo/AnimationPlayer".pop_out() $"../..".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() + $"../StartSchildLogo/AnimationPlayer".pop_out() + $AnimationPlayer.pop_out() $"../Settings".open() diff --git a/code/first_save.json b/code/first_save.json index 9df3c7e..4371548 100644 --- a/code/first_save.json +++ b/code/first_save.json @@ -1,3 +1,4 @@ { - "hiscore":0 + "hiscore":0, + "coins":0 } diff --git a/code/global.gd b/code/global.gd index 2e23c48..10e2ef3 100644 --- a/code/global.gd +++ b/code/global.gd @@ -12,40 +12,13 @@ var active_biom var gamerunning = false -var hiscore +var hiscore:int +var coins:int func _ready() -> void: - load_save() - #write_save() -func load_save(): - var data : FileAccess - if (not FileAccess.file_exists("user://save.json")) or (FileAccess.open("user://save.json", FileAccess.READ_WRITE).get_as_text() == ""): - data = FileAccess.open("user://save.json", FileAccess.WRITE) - data.store_string(FileAccess.open("res://code/first_save.json", FileAccess.READ).get_as_text()) - data.close() - data = FileAccess.open("user://save.json", FileAccess.READ) - - var content_text = JSON.parse_string(data.get_as_text()) - - if content_text: - print("loaded: ",content_text) - hiscore = content_text.get("hiscore", 0) - else: - print("Failed to parse JSON") - data.close() - - -func write_save(): - var data : FileAccess - data = FileAccess.open("user://save.json",FileAccess.WRITE) - var content = JSON.stringify( - { - "hiscore":$/root/Game/Gui/ScoreContainer.get_score() - } - ) - print("saved: ",content) - data.store_string(content) - + var save = load_save() + hiscore = save["hiscore"] + coins = save["hiscore"] func reset_game(): speed = 100 @@ -53,5 +26,39 @@ func reset_game(): active_biom = "n" gamerunning = false _ready() - $/root/Game/Fade/FadeAnimation.play("fade") get_tree().reload_current_scene() + + +var data : FileAccess + +func load_save() -> Dictionary: + # wenn kein save vorhanden ist, erstelle eins + if (not FileAccess.file_exists("user://save.json")) or (FileAccess.open("user://save.json", FileAccess.READ_WRITE).get_as_text() == ""): + init_save() + + data = FileAccess.open("user://save.json", FileAccess.READ) + var content_text: Dictionary = JSON.parse_string(data.get_as_text()) + + if content_text: + print("loaded: ",content_text) + return content_text + else: + print("Failed to parse JSON") + return {} + + +func write_save(): + var sdata : FileAccess + sdata = FileAccess.open("user://save.json",FileAccess.WRITE) + var content = JSON.stringify( + { + "hiscore":$/root/Game/Gui/ScoreContainer.get_score() + } + ) + print("saved: ",content) + sdata.store_string(content) + +func init_save(): + data = FileAccess.open("user://save.json", FileAccess.WRITE) + data.store_string(FileAccess.open("res://code/first_save.json", FileAccess.READ).get_as_text()) + data.close() diff --git a/code/hiscore.gd b/code/hiscore.gd index 0530526..e500721 100644 --- a/code/hiscore.gd +++ b/code/hiscore.gd @@ -1,13 +1,5 @@ extends Label -# Called when the node enters the scene tree for the first time. func _ready() -> void: text = str($"/root/Global".hiscore) - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass - -#func get_score(): -# return int(text) diff --git a/code/main.gd b/code/main.gd index 150002b..2077ebd 100644 --- a/code/main.gd +++ b/code/main.gd @@ -1,7 +1,7 @@ extends Node func _ready() -> void: - $Fade/FadeAnimation.play_backwards("fade") + $Fade/Animation.play_backwards("fade") $Screen/Background/Floor/EasterEggFixCollision.disabled = false $Gui/HiscoreContainer.show() %ScoreContainer.hide() diff --git a/code/score.gd b/code/score.gd index e4d6aea..942935e 100644 --- a/code/score.gd +++ b/code/score.gd @@ -7,7 +7,7 @@ func _ready() -> void: # Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: +func _process(_delta: float) -> void: pass func get_score(): diff --git a/scenes/Duck/Duck.gd b/scenes/Duck/Duck.gd index eff2a1b..b5eb799 100644 --- a/scenes/Duck/Duck.gd +++ b/scenes/Duck/Duck.gd @@ -7,6 +7,9 @@ signal gameover @onready var alive = true var state = "main-menu" +func _ready() -> void: + %Skin.change_to(0) + func die(): print("die") gameover.emit() @@ -26,7 +29,7 @@ func _physics_process(delta: float) -> void: move_and_slide() func _process(_delta: float) -> void: - if position.x < 20 or position.y > 100: + if global_position.x < 20 or global_position.y > 100: if alive: die() @@ -43,11 +46,6 @@ func _process(_delta: float) -> void: else: $AnimationPlayer.play("walk") -func _collide_with_hindernis(_body: Node2D) -> void: - pass - #if alive: - # die() - func _color_slider_changed(value) -> void: $EnteConstantSprite/EnteColormask.modulate.h = $"../../Gui/Settings/ColorSlider".value*0.01 @@ -55,3 +53,4 @@ func _color_slider_changed(value) -> void: func _on_ente_sprite_frame_changed() -> void: $EnteConstantSprite/EnteColormask.frame = $EnteConstantSprite.frame + $EnteConstantSprite/Skin.frame = $EnteConstantSprite.frame diff --git a/scenes/Duck/Duck.tscn b/scenes/Duck/Duck.tscn index cbc47ed..c4f757f 100644 --- a/scenes/Duck/Duck.tscn +++ b/scenes/Duck/Duck.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=12 format=3 uid="uid://8v5mbbnddorh"] +[gd_scene load_steps=14 format=3 uid="uid://8v5mbbnddorh"] [ext_resource type="Texture2D" uid="uid://dc6grg2oaq3a6" path="res://scenes/Duck/ente.png" id="1"] [ext_resource type="Script" path="res://scenes/Duck/Duck.gd" id="1_pvotk"] [ext_resource type="Texture2D" uid="uid://dsifqpp5l00cr" path="res://scenes/Duck/ente_colormask.png" id="3_a4v8w"] +[ext_resource type="Texture2D" uid="uid://c1mq2xs0uuoxu" path="res://scenes/Duck/customs/1.png" id="4_acy8u"] +[ext_resource type="Script" path="res://scenes/Duck/skin.gd" id="4_gc1nf"] [sub_resource type="Animation" id="5"] length = 0.001 @@ -113,8 +115,9 @@ libraries = { [node name="EnteConstantSprite" type="Sprite2D" parent="."] texture_filter = 3 -position = Vector2(0, -7) +position = Vector2(-8, -16) texture = ExtResource("1") +centered = false hframes = 3 vframes = 2 frame = 4 @@ -122,9 +125,18 @@ frame = 4 [node name="EnteColormask" type="Sprite2D" parent="EnteConstantSprite"] modulate = Color(1, 1, 0, 1) texture = ExtResource("3_a4v8w") +centered = false hframes = 3 vframes = 2 +[node name="Skin" type="Sprite2D" parent="EnteConstantSprite"] +unique_name_in_owner = true +texture = ExtResource("4_acy8u") +centered = false +hframes = 3 +vframes = 2 +script = ExtResource("4_gc1nf") + [node name="physicsbox" type="CollisionShape2D" parent="."] position = Vector2(2.38419e-07, -6) scale = Vector2(5, 5) diff --git a/scenes/Duck/customs/0.png b/scenes/Duck/customs/0.png new file mode 100644 index 0000000..fdcdc40 Binary files /dev/null and b/scenes/Duck/customs/0.png differ diff --git a/scenes/Duck/customs/0.png.import b/scenes/Duck/customs/0.png.import new file mode 100644 index 0000000..60a689a --- /dev/null +++ b/scenes/Duck/customs/0.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ce0vevqn8ato7" +path="res://.godot/imported/0.png-940815318ee3975aa08c57ce3dd29bc8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/Duck/customs/0.png" +dest_files=["res://.godot/imported/0.png-940815318ee3975aa08c57ce3dd29bc8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=1 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/Duck/customs/1.png b/scenes/Duck/customs/1.png new file mode 100644 index 0000000..7e40203 Binary files /dev/null and b/scenes/Duck/customs/1.png differ diff --git a/scenes/Duck/customs/1.png.import b/scenes/Duck/customs/1.png.import new file mode 100644 index 0000000..5f05c8e --- /dev/null +++ b/scenes/Duck/customs/1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c1mq2xs0uuoxu" +path="res://.godot/imported/1.png-db9f6a2a43cc52b4b34f318375c7f5a7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/Duck/customs/1.png" +dest_files=["res://.godot/imported/1.png-db9f6a2a43cc52b4b34f318375c7f5a7.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=1 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/Duck/customs/2.png b/scenes/Duck/customs/2.png new file mode 100644 index 0000000..bd1d60f Binary files /dev/null and b/scenes/Duck/customs/2.png differ diff --git a/scenes/Duck/customs/2.png.import b/scenes/Duck/customs/2.png.import new file mode 100644 index 0000000..ea1d344 --- /dev/null +++ b/scenes/Duck/customs/2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cgs3hrxrrslip" +path="res://.godot/imported/2.png-e7ef44db5e8ec5954a8c29fb6584d647.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/Duck/customs/2.png" +dest_files=["res://.godot/imported/2.png-e7ef44db5e8ec5954a8c29fb6584d647.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/Duck/customs/3.png b/scenes/Duck/customs/3.png new file mode 100644 index 0000000..51478b4 Binary files /dev/null and b/scenes/Duck/customs/3.png differ diff --git a/scenes/Duck/customs/3.png.import b/scenes/Duck/customs/3.png.import new file mode 100644 index 0000000..725f313 --- /dev/null +++ b/scenes/Duck/customs/3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bs7mitmimjd4d" +path="res://.godot/imported/3.png-c65c606fbe3fd8bad5ef424c13f9ca84.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/Duck/customs/3.png" +dest_files=["res://.godot/imported/3.png-c65c606fbe3fd8bad5ef424c13f9ca84.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/Duck/customs/skin-vorlage.aseprite b/scenes/Duck/customs/skin-vorlage.aseprite new file mode 100644 index 0000000..29091cd Binary files /dev/null and b/scenes/Duck/customs/skin-vorlage.aseprite differ diff --git a/scenes/Duck/skin.gd b/scenes/Duck/skin.gd new file mode 100644 index 0000000..b2f11b3 --- /dev/null +++ b/scenes/Duck/skin.gd @@ -0,0 +1,5 @@ +extends Sprite2D + + +func change_to(custom_number:int): + texture = load("res://scenes/Duck/customs/{s}.png".format({"s":str(custom_number)})) diff --git a/scenes/Main.tscn b/scenes/Main.tscn index 1ea528d..12bfcd7 100644 --- a/scenes/Main.tscn +++ b/scenes/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=49 format=3 uid="uid://bb5qp5868y5i"] +[gd_scene load_steps=51 format=3 uid="uid://bb5qp5868y5i"] [ext_resource type="Script" path="res://code/main.gd" id="1_ar2ah"] [ext_resource type="PackedScene" uid="uid://8v5mbbnddorh" path="res://scenes/Duck/Duck.tscn" id="2"] @@ -11,8 +11,8 @@ [ext_resource type="Script" path="res://scenes/Wolke/Spawner/wolken_spawner.gd" id="11_x2wm3"] [ext_resource type="Script" path="res://scenes/easteregg/Spawner/easteregg_spawner.gd" id="12_hl8it"] [ext_resource type="FontFile" uid="uid://ddvhypxkj8a1b" path="res://Megamichisfont-small.otf" id="13_666gv"] +[ext_resource type="Texture2D" uid="uid://cfmflpkl335e3" path="res://assets/GUI/schild.png" id="13_yjq5c"] [ext_resource type="Script" path="res://code/hiscore.gd" id="14_ah063"] -[ext_resource type="PackedScene" uid="uid://dm307sj4nenjt" path="res://scenes/schild.tscn" id="15_1xp2x"] [ext_resource type="Texture2D" uid="uid://fon35dtl2fdd" path="res://assets/GUI/buttons fucused/back button f.png" id="15_2rflk"] [ext_resource type="Script" path="res://code/GUI/settingsschild.gd" id="16_4ssry"] [ext_resource type="Texture2D" uid="uid://nvn254p6tk8j" path="res://assets/GUI/back button.png" id="17_3kek5"] @@ -27,233 +27,76 @@ [ext_resource type="AudioStream" uid="uid://ctt1kb2a66yyl" path="res://assets/audio/boing.mp3" id="21_ch5yv"] [ext_resource type="AudioStream" uid="uid://bktthpfrs0118" path="res://assets/audio/gui-out.ogg" id="21_frskh"] [ext_resource type="Script" path="res://code/GUI/startschild.gd" id="21_owbcl"] +[ext_resource type="Script" path="res://code/GUI/restartschild.gd" id="21_ytgei"] [ext_resource type="AudioStream" uid="uid://c4wrtvywao1jn" path="res://assets/audio/duckrun.wav" id="22_ijpe0"] [ext_resource type="Texture2D" uid="uid://d2i2d0rmdtklc" path="res://assets/GUI/start button.png" id="22_x686b"] [ext_resource type="Texture2D" uid="uid://dqvnnd3o1eele" path="res://assets/GUI/settings button.png" id="23_on2gf"] [ext_resource type="Texture2D" uid="uid://bj7bgtdcbdald" path="res://assets/GUI/logo.png" id="24_8b8my"] [ext_resource type="Script" path="res://code/score.gd" id="25_2prek"] [ext_resource type="Texture2D" uid="uid://c66oktmsmdu0f" path="res://assets/GUI/buttons fucused/settings button f.png" id="25_bjwbg"] +[ext_resource type="PackedScene" uid="uid://dm307sj4nenjt" path="res://scenes/ui/animation.tscn" id="30_30gpa"] +[ext_resource type="PackedScene" uid="uid://yiu5npbi008a" path="res://scenes/ui/animation_logo.tscn" id="31_ugbfy"] -[sub_resource type="Animation" id="Animation_28fei"] +[sub_resource type="GDScript" id="GDScript_xq7jv"] +script/source = "extends ColorRect + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + visible = true +" + +[sub_resource type="Animation" id="Animation_0cnuw"] length = 0.001 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath(".:color") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.0001), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Color(1, 1, 1, 1), Color(0, 0, 0, 1)] -} - -[sub_resource type="Animation" id="Animation_yef6t"] -resource_name = "fade" -length = 0.1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath(".:color") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.1), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Color(1, 1, 1, 1), Color(0, 0, 0, 1)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_s1fwp"] -_data = { -"RESET": SubResource("Animation_28fei"), -"fade": SubResource("Animation_yef6t") -} - -[sub_resource type="Animation" id="Animation_4fx6d"] -resource_name = "Fade" -length = 0.45 -step = 0.1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("..:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.4), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Color(1, 1, 1, 1), Color(0, 0, 0, 1)] -} - -[sub_resource type="Animation" id="Animation_j0xom"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("..:modulate") +tracks/0/path = NodePath(".:modulate") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 0, -"values": [Color(1, 1, 1, 1)] +"values": [Color(1, 1, 1, 0)] } -[sub_resource type="Animation" id="Animation_otim5"] -resource_name = "change_time" -length = 3.0 -step = 0.1 +[sub_resource type="Animation" id="Animation_tt0ob"] +resource_name = "fade" +length = 0.3 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath(".:color") +tracks/0/path = NodePath(".:modulate") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 2.8), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Color(0.162512, 0.669077, 0.79808, 1), Color(0.0375358, 0.131849, 0.373243, 1)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("..:modulate") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 3), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Color(1, 1, 1, 1), Color(0.493545, 0.493546, 0.493546, 1)] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("../Background/Stars:modulate") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0, 3), +"times": PackedFloat32Array(0, 0.3), "transitions": PackedFloat32Array(1, 1), "update": 0, "values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] } -[sub_resource type="Animation" id="Animation_7cwe6"] -resource_name = "change_timeold" -length = 6.0 -step = 0.25 -tracks/0/type = "bezier" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("..:modulate:r") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"handle_modes": PackedInt32Array(0, 0), -"points": PackedFloat32Array(1, -0.5, 0, 1, 0, 0.6, -1, 0, 0.5, 0), -"times": PackedFloat32Array(0, 6) -} -tracks/1/type = "bezier" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("..:modulate:g") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"handle_modes": PackedInt32Array(0, 0), -"points": PackedFloat32Array(1, -0.5, 0, 1, 0, 0.6, -1, 0, 0.5, 0), -"times": PackedFloat32Array(0, 6) -} -tracks/2/type = "bezier" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("..:modulate:b") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"handle_modes": PackedInt32Array(0, 0), -"points": PackedFloat32Array(1, -0.5, 0, 1, 0, 0.6, -1, 0, 0.5, 0), -"times": PackedFloat32Array(0, 6) -} -tracks/3/type = "bezier" -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/path = NodePath(".:color:r") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/keys = { -"handle_modes": PackedInt32Array(0, 0), -"points": PackedFloat32Array(0.560784, -0.25, 0, 0.25, 0, 0.1, -0.5, 0, 0.25, 0), -"times": PackedFloat32Array(0, 6) -} -tracks/4/type = "bezier" -tracks/4/imported = false -tracks/4/enabled = true -tracks/4/path = NodePath(".:color:g") -tracks/4/interp = 1 -tracks/4/loop_wrap = true -tracks/4/keys = { -"handle_modes": PackedInt32Array(0, 0), -"points": PackedFloat32Array(0.937255, -0.25, 0, 0.25, 0, 0.1, -0.5, 0, 0.25, 0), -"times": PackedFloat32Array(0, 6) -} -tracks/5/type = "bezier" -tracks/5/imported = false -tracks/5/enabled = true -tracks/5/path = NodePath(".:color:b") -tracks/5/interp = 1 -tracks/5/loop_wrap = true -tracks/5/keys = { -"handle_modes": PackedInt32Array(0, 0), -"points": PackedFloat32Array(0.937255, -0.25, 0, 0.25, 0, 0.3, -0.25, 0, 0.25, 0), -"times": PackedFloat32Array(0, 6) -} -tracks/6/type = "bezier" -tracks/6/imported = false -tracks/6/enabled = true -tracks/6/path = NodePath("../Background/Stars:modulate:a") -tracks/6/interp = 1 -tracks/6/loop_wrap = true -tracks/6/keys = { -"handle_modes": PackedInt32Array(0, 0), -"points": PackedFloat32Array(0, -0.25, 0, 1, 0, 1, -1, 0, 0.25, 0), -"times": PackedFloat32Array(0, 6) -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_c30x0"] +[sub_resource type="AnimationLibrary" id="AnimationLibrary_qrakk"] _data = { -"Fade": SubResource("Animation_4fx6d"), -"RESET": SubResource("Animation_j0xom"), -"change_time": SubResource("Animation_otim5"), -"change_timeold": SubResource("Animation_7cwe6") +"RESET": SubResource("Animation_0cnuw"), +"fade": SubResource("Animation_tt0ob") } [sub_resource type="GDScript" id="GDScript_rkc4w"] script/source = "extends Timer var day = true -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass func _change_time() -> void: if day: $\"../AnimationPlayer\".play(\"change_time\") + print(\"playing\") day = not day else: $\"../AnimationPlayer\".play_backwards(\"change_time\") + print(\"playing r\") day = not day " @@ -264,6 +107,78 @@ size = Vector2(2, 9.75) [sub_resource type="RectangleShape2D" id="RectangleShape2D_0a3yj"] size = Vector2(356.5, 8) +[sub_resource type="Animation" id="Animation_plyvn"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("../Fade:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("BackgroundColor:color") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(0.160784, 0.670588, 0.8, 1)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath(".:modulate") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 1)] +} + +[sub_resource type="Animation" id="Animation_8pa57"] +resource_name = "change_time" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("BackgroundColor:color") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Color(0.160784, 0.670588, 0.8, 1), Color(0.086, 0.0917334, 0.43, 1)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Color(1, 1, 1, 1), Color(0.470075, 0.470076, 0.470076, 1)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_t75gq"] +_data = { +"RESET": SubResource("Animation_plyvn"), +"change_time": SubResource("Animation_8pa57") +} + [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jin1w"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_g0rdc"] @@ -290,32 +205,35 @@ HSlider/styles/slider = SubResource("StyleBoxFlat_xb3tf") [node name="Game" type="Node"] script = ExtResource("1_ar2ah") -[node name="Fade" type="CanvasModulate" parent="."] +[node name="Fade" type="ColorRect" parent="."] +modulate = Color(1, 1, 1, 0) +z_index = 1 +z_as_relative = false +offset_top = -9.0 +offset_right = 485.0 +offset_bottom = 300.0 +mouse_filter = 2 +color = Color(0, 0, 0, 1) +script = SubResource("GDScript_xq7jv") +metadata/_edit_lock_ = true -[node name="FadeAnimation" type="AnimationPlayer" parent="Fade"] -unique_name_in_owner = true +[node name="Animation" type="AnimationPlayer" parent="Fade"] libraries = { -"": SubResource("AnimationLibrary_s1fwp") +"": SubResource("AnimationLibrary_qrakk") } [node name="Screen" type="Node2D" parent="."] script = ExtResource("2_cix0i") -[node name="ColorRect" type="ColorRect" parent="Screen"] +[node name="BackgroundColor" type="ColorRect" parent="Screen"] offset_left = -10.0 offset_top = -9.0 offset_right = 561.0 offset_bottom = 111.0 color = Color(0.160784, 0.670588, 0.8, 1) -[node name="AnimationPlayer" type="AnimationPlayer" parent="Screen"] -root_node = NodePath("") -libraries = { -"": SubResource("AnimationLibrary_c30x0") -} - [node name="Day-NightTimer" type="Timer" parent="Screen"] -wait_time = 12.0 +wait_time = 15.0 autostart = true script = SubResource("GDScript_rkc4w") @@ -351,10 +269,10 @@ position = Vector2(178.25, 96) shape = SubResource("RectangleShape2D_0a3yj") [node name="Duck" parent="Screen" instance=ExtResource("2")] -position = Vector2(21, 91) +position = Vector2(25, 52) [node name="CoinSpawner" type="Marker2D" parent="Screen"] -position = Vector2(485, 83) +position = Vector2(485, 80) script = ExtResource("8_7ggb5") [node name="HurdleSpawner" type="Marker2D" parent="Screen"] @@ -371,6 +289,13 @@ wait_time = 1.6 [node name="CoinSpawnTimer" type="Timer" parent="Screen"] wait_time = 1.6 +[node name="partices" type="Node2D" parent="Screen"] + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Screen"] +libraries = { +"": SubResource("AnimationLibrary_t75gq") +} + [node name="Gui" type="Control" parent="."] layout_mode = 3 anchors_preset = 15 @@ -405,14 +330,12 @@ theme_override_font_sizes/font_size = 8 text = "0" script = ExtResource("14_ah063") -[node name="Settings" parent="Gui" instance=ExtResource("15_1xp2x")] +[node name="Settings" type="TextureRect" parent="Gui"] visible = false layout_mode = 1 anchors_preset = 1 anchor_left = 1.0 -anchor_top = 0.0 anchor_right = 1.0 -anchor_bottom = 0.0 offset_left = -102.0 offset_top = -68.0 offset_right = -2.0 @@ -420,6 +343,7 @@ offset_bottom = 82.0 grow_horizontal = 0 size_flags_horizontal = 8 size_flags_vertical = 4 +texture = ExtResource("13_yjq5c") stretch_mode = 2 script = ExtResource("16_4ssry") @@ -508,7 +432,9 @@ toggle_mode = true texture_normal = ExtResource("19_vwek8") texture_focused = ExtResource("18_ahbxs") -[node name="GameOverSchild" parent="Gui" instance=ExtResource("15_1xp2x")] +[node name="AnimationPlayer" parent="Gui/Settings" instance=ExtResource("30_30gpa")] + +[node name="GameOverSchild" type="TextureRect" parent="Gui"] visible = false layout_mode = 1 anchors_preset = 8 @@ -522,9 +448,11 @@ offset_right = 49.0 offset_bottom = 34.0 grow_horizontal = 2 grow_vertical = 2 +size_flags_horizontal = 4 size_flags_vertical = 4 +texture = ExtResource("13_yjq5c") stretch_mode = 2 -metadata/_edit_lock_ = true +script = ExtResource("21_ytgei") [node name="Restart" type="TextureButton" parent="Gui/GameOverSchild"] texture_repeat = 2 @@ -559,20 +487,23 @@ offset_bottom = -18.3 texture_normal = ExtResource("17_3kek5") texture_focused = ExtResource("15_2rflk") -[node name="StartSchild" parent="Gui" instance=ExtResource("15_1xp2x")] +[node name="AnimationPlayer" parent="Gui/GameOverSchild" instance=ExtResource("30_30gpa")] + +[node name="StartSchild" type="TextureRect" parent="Gui"] layout_mode = 1 anchors_preset = 6 anchor_left = 1.0 anchor_top = 0.5 anchor_right = 1.0 anchor_bottom = 0.5 -offset_left = -101.0 -offset_top = -114.0 -offset_right = -1.0 -offset_bottom = 36.0 +offset_left = -100.0 +offset_top = -117.0 +offset_bottom = 33.0 grow_horizontal = 0 grow_vertical = 2 +size_flags_horizontal = 4 size_flags_vertical = 4 +texture = ExtResource("13_yjq5c") stretch_mode = 2 script = ExtResource("21_owbcl") @@ -612,34 +543,32 @@ offset_bottom = -8.55 grow_horizontal = 2 grow_vertical = 2 scale = Vector2(3, 3) -focus_neighbor_left = NodePath("../Logo") +focus_neighbor_left = NodePath("../../StartSchildLogo") focus_neighbor_right = NodePath("../Start") focus_next = NodePath("../Start") -focus_previous = NodePath("../Logo") +focus_previous = NodePath("../../StartSchildLogo") texture_normal = ExtResource("23_on2gf") texture_focused = ExtResource("25_bjwbg") stretch_mode = 1 -[node name="Logo" type="TextureButton" parent="Gui/StartSchild"] -layout_mode = 1 -anchors_preset = 3 -anchor_left = 1.0 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = -177.0 -offset_top = -38.0 -offset_right = -49.0 -offset_bottom = -9.0 -grow_horizontal = 0 -grow_vertical = 0 +[node name="AnimationPlayer" parent="Gui/StartSchild" instance=ExtResource("30_30gpa")] + +[node name="StartSchildLogo" type="TextureButton" parent="Gui"] +layout_direction = 1 +layout_mode = 0 +offset_left = -7.0 +offset_top = 44.0 +offset_right = 121.0 +offset_bottom = 73.0 rotation = -0.413643 size_flags_horizontal = 4 size_flags_vertical = 4 -focus_neighbor_right = NodePath("../Settings") -focus_next = NodePath("../Settings") +focus_neighbor_right = NodePath("../StartSchild/Settings") +focus_next = NodePath("../StartSchild/Settings") texture_normal = ExtResource("24_8b8my") +[node name="AnimationPlayer" parent="Gui/StartSchildLogo" instance=ExtResource("31_ugbfy")] + [node name="ScoreContainer" type="HBoxContainer" parent="Gui"] unique_name_in_owner = true layout_mode = 1 @@ -704,5 +633,5 @@ bus = &"Background" [connection signal="pressed" from="Gui/GameOverSchild/back" to="Gui/GameOverSchild" method="_on_back_pressed"] [connection signal="pressed" from="Gui/StartSchild/Start" to="Gui/StartSchild" method="_on_start_pressed"] [connection signal="pressed" from="Gui/StartSchild/Settings" to="Gui/StartSchild" method="_on_settings_pressed"] -[connection signal="pressed" from="Gui/StartSchild/Logo" to="Gui/EastereggSpawner" method="_spawn"] +[connection signal="pressed" from="Gui/StartSchildLogo" to="Gui/EastereggSpawner" method="_spawn"] [connection signal="timeout" from="Gui/ScoreContainer/score/ScoreCounter" to="." method="_score"] diff --git a/scenes/Wolke/wolke.gd b/scenes/Wolke/wolke.gd index f299a90..f746c22 100644 --- a/scenes/Wolke/wolke.gd +++ b/scenes/Wolke/wolke.gd @@ -12,5 +12,3 @@ func _ready() -> void: func _process(delta: float) -> void: global_position.x -= speed * delta - if global_position.x < -30: - queue_free() diff --git a/scenes/Wolke/wolke.tscn b/scenes/Wolke/wolke.tscn index baa4016..39ad59a 100644 --- a/scenes/Wolke/wolke.tscn +++ b/scenes/Wolke/wolke.tscn @@ -8,3 +8,7 @@ texture_filter = 1 texture = ExtResource("1_c6lhp") hframes = 5 script = ExtResource("2_tsh5n") + +[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."] + +[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="queue_free"] diff --git a/scenes/coin/coin.gd b/scenes/coin/coin.gd index 5e85b24..e970335 100644 --- a/scenes/coin/coin.gd +++ b/scenes/coin/coin.gd @@ -12,9 +12,11 @@ func _physics_process(delta: float) -> void: func _on_body_entered(body: Node2D) -> void: if body.name == "Duck": + #print("duck touched") $AnimationPlayer.play("explode") - await $AnimationPlayer.animation_finished - queue_free() + #await await $AnimationPlayer.animation_finished + ##queue_free() + #print("animation finisched") # add coin if body.name == "hurdle": - queue_free() + pass#queue_free() diff --git a/scenes/coin/coin.tscn b/scenes/coin/coin.tscn index 5195fc2..9f0358c 100644 --- a/scenes/coin/coin.tscn +++ b/scenes/coin/coin.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=3 uid="uid://b0au341yw6g52"] +[gd_scene load_steps=13 format=3 uid="uid://b0au341yw6g52"] [ext_resource type="Texture2D" uid="uid://dtn6mbn4q0plm" path="res://scenes/coin/coin.png" id="1_4vkkb"] [ext_resource type="Script" path="res://scenes/coin/coin.gd" id="1_xp82m"] @@ -29,6 +29,71 @@ tracks/1/keys = { "update": 0, "values": [Color(1, 1, 1, 1)] } +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = false +tracks/2/path = NodePath("GPUParticles2D:emitting") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("Sprite:position") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(0, 0)] +} + +[sub_resource type="Animation" id="Animation_6xqsk"] +resource_name = "explode" +length = 0.2 +step = 0.01 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0.01, 0.2), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("GPUParticles2D:emitting") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Sprite:position") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.2), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector2(0, 0), Vector2(0, -12)] +} [sub_resource type="Animation" id="Animation_64j7p"] resource_name = "rotate" @@ -46,23 +111,6 @@ tracks/0/keys = { "values": [0, 1, 2, 1] } -[sub_resource type="Animation" id="Animation_6xqsk"] -resource_name = "explode" -length = 0.1 -step = 0.01 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Sprite:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.09), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_om3ic"] _data = { "RESET": SubResource("Animation_jfpvc"), @@ -73,7 +121,32 @@ _data = { [sub_resource type="CircleShape2D" id="CircleShape2D_qamc5"] radius = 3.0 +[sub_resource type="Gradient" id="Gradient_b4fpo"] +offsets = PackedFloat32Array(0, 0.321839, 1) +colors = PackedColorArray(1, 0.921828, 0.423545, 1, 0.98436, 0.850996, 0, 1, 0.79237, 0.68246, 0, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_sasf4"] +gradient = SubResource("Gradient_b4fpo") + +[sub_resource type="Curve" id="Curve_01enh"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -2.83732, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_1vf08"] +curve = SubResource("Curve_01enh") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_bv68t"] +particle_flag_disable_z = true +spread = 180.0 +initial_velocity_min = 15.0 +initial_velocity_max = 30.0 +gravity = Vector3(0, 0, 0) +scale_max = 3.0 +scale_curve = SubResource("CurveTexture_1vf08") +color_initial_ramp = SubResource("GradientTexture1D_sasf4") + [node name="Coin" type="Area2D"] +position = Vector2(3, 3) script = ExtResource("1_xp82m") [node name="Sprite" type="Sprite2D" parent="."] @@ -90,4 +163,12 @@ libraries = { visible = false shape = SubResource("CircleShape2D_qamc5") +[node name="GPUParticles2D" type="GPUParticles2D" parent="."] +visible = false +emitting = false +amount = 9 +process_material = SubResource("ParticleProcessMaterial_bv68t") +lifetime = 0.5 +explosiveness = 1.0 + [connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/scenes/coin/spawner/coin_spawner.gd b/scenes/coin/spawner/coin_spawner.gd index f6fdde0..eb3c86d 100644 --- a/scenes/coin/spawner/coin_spawner.gd +++ b/scenes/coin/spawner/coin_spawner.gd @@ -13,7 +13,7 @@ func _spawn() -> void: var v1 = 1.5 - (speed / 200)#260 var v2 = 2.0 - (speed / 200) - coin.global_position.y -= randi_range(0,2)*16 + coin.global_position.y -= randi_range(0,2)*14 $"../CoinSpawnTimer".wait_time = randf_range(v1,v2) add_child(coin) diff --git a/scenes/easteregg/easteregg.gd b/scenes/easteregg/easteregg.gd index 8305e24..c9f2427 100644 --- a/scenes/easteregg/easteregg.gd +++ b/scenes/easteregg/easteregg.gd @@ -1,13 +1,5 @@ extends RigidBody2D - -# Called when the node enters the scene tree for the first time. func _ready() -> void: $Sprite.frame = randi_range(0,12) position.x += randi_range(-10,10) - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - if global_position.y > 100: - queue_free() diff --git a/scenes/easteregg/easteregg.tscn b/scenes/easteregg/easteregg.tscn index 31dc800..b2e0a6a 100644 --- a/scenes/easteregg/easteregg.tscn +++ b/scenes/easteregg/easteregg.tscn @@ -10,14 +10,20 @@ radius = 8.06226 script = ExtResource("1_3dnpr") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2(0, -7) +position = Vector2(8, 9) shape = SubResource("CircleShape2D_ruej1") [node name="Sprite" type="Sprite2D" parent="."] texture_filter = 1 -position = Vector2(0, -7) texture = ExtResource("1_al4up") -offset = Vector2(0, 0.5) +centered = false hframes = 5 vframes = 3 -frame = 3 +frame = 1 + +[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."] +position = Vector2(1, 1) +rect = Rect2(0, 0, 14, 14) + +[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="queue_free"] +[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_screen_exited"] diff --git a/scenes/ground/ground.gd b/scenes/ground/ground.gd index 414ae65..ce3c702 100644 --- a/scenes/ground/ground.gd +++ b/scenes/ground/ground.gd @@ -7,11 +7,10 @@ var speed: float func _ready() -> void: pass -func _physics_process(delta: float) -> void: +func _process(delta: float) -> void: if $"/root/Global".gamerunning: + print("ahhhh") global_position.x -= $"/root/Global".speed*delta - if global_position.y < -30: - queue_free() func screen_e() -> void: diff --git a/scenes/ground/spawner/ground_spawner.gd b/scenes/ground/spawner/ground_spawner.gd index 6f970bc..40a5359 100644 --- a/scenes/ground/spawner/ground_spawner.gd +++ b/scenes/ground/spawner/ground_spawner.gd @@ -21,6 +21,15 @@ func probability(prozent): return randf() > 1 - (0.01 * prozent) func change_biom(): + #if active_biom == "w_n": + # active_biom = "n" + #elif active_biom == "s_n": + # active_biom = "n" + #elif active_biom == "n_w": + # active_biom = "w" + #elif active_biom == "n_s": + # active_biom = "s" + if biom_type == "n": change_in -= 1 if probability(60): diff --git a/scenes/hurdle/hurdle.gd b/scenes/hurdle/hurdle.gd index 489b438..170608b 100644 --- a/scenes/hurdle/hurdle.gd +++ b/scenes/hurdle/hurdle.gd @@ -15,5 +15,3 @@ func _ready() -> void: func _process(delta: float) -> void: speed = $"/root/Global".speed global_position.x -= speed*delta - if global_position.x < -30: - queue_free() diff --git a/scenes/hurdle/hurdle.tscn b/scenes/hurdle/hurdle.tscn index 9f5c041..873d1fe 100644 --- a/scenes/hurdle/hurdle.tscn +++ b/scenes/hurdle/hurdle.tscn @@ -7,7 +7,7 @@ radius = 5.0 [sub_resource type="CircleShape2D" id="CircleShape2D_r1tmj"] -radius = 5.0 +radius = 6.0 [node name="hurdle" type="CharacterBody2D"] collision_layer = 3 @@ -16,17 +16,17 @@ script = ExtResource("1_e0hqe") [node name="Sprite" type="Sprite2D" parent="."] texture_filter = 1 -position = Vector2(0, -8) +position = Vector2(-8, -15) texture = ExtResource("2_thg8w") -offset = Vector2(0, 0.5) +centered = false hframes = 5 vframes = 3 -frame = 14 +frame = 8 region_enabled = true region_rect = Rect2(0, 0, 80, 48) [node name="collision" type="CollisionShape2D" parent="."] -position = Vector2(0, -7) +position = Vector2(0, -5) shape = SubResource("CircleShape2D_orpyb") [node name="Area2D" type="Area2D" parent="."] @@ -35,5 +35,12 @@ collision_layer = 3 collision_mask = 3 [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +position = Vector2(0, 1) shape = SubResource("CircleShape2D_r1tmj") debug_color = Color(0.906661, 0.254677, 0.42413, 0.42) + +[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."] +position = Vector2(3, -4) +rect = Rect2(-10, -10, 14, 14) + +[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="queue_free"] diff --git a/scenes/ui/animation.gd b/scenes/ui/animation.gd new file mode 100644 index 0000000..bde2413 --- /dev/null +++ b/scenes/ui/animation.gd @@ -0,0 +1,12 @@ +extends AnimationPlayer + +func pop_in(): + play_backwards("out-in") + $"../../../Audio/Gui-in".play() + get_parent().show() + +func pop_out(): + play("out-in") + $"../../../Audio/Gui-out".play() + await animation_finished + get_parent().hide() diff --git a/scenes/schild.tscn b/scenes/ui/animation.tscn similarity index 50% rename from scenes/schild.tscn rename to scenes/ui/animation.tscn index a11b637..53e6daf 100644 --- a/scenes/schild.tscn +++ b/scenes/ui/animation.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=6 format=3 uid="uid://dm307sj4nenjt"] +[gd_scene load_steps=5 format=3 uid="uid://dm307sj4nenjt"] -[ext_resource type="Texture2D" uid="uid://cfmflpkl335e3" path="res://assets/GUI/schild.png" id="1_wyhk0"] -[ext_resource type="Script" path="res://code/GUI/restartschild.gd" id="2_pxsow"] +[ext_resource type="Script" path="res://scenes/ui/animation.gd" id="1_43757"] [sub_resource type="Animation" id="Animation_hmob6"] length = 0.001 @@ -17,7 +16,7 @@ tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { "handle_modes": PackedInt32Array(0, 0, 0), -"points": PackedFloat32Array(-67, -0.25, 0, 0.0666667, 0.981804, -56.456, -0.1, -0.683014, 0.0666667, 1.36603, -250, -0.133333, -1.11485, 0.15, 0), +"points": PackedFloat32Array(-67, -0.25, 0, 0.0666667, 0.981804, -56, -0.1, -0.683014, 0.0666667, 1.36603, -250, -0.133333, -1.11485, 0.15, 0), "times": PackedFloat32Array(0, 0.133333, 0.5) } @@ -27,21 +26,8 @@ _data = { "out-in": SubResource("Animation_wgvxk") } -[node name="Schild" type="TextureRect"] -anchors_preset = -1 -anchor_left = -0.259 -anchor_top = 0.14 -anchor_right = 0.282 -anchor_bottom = 0.79 -offset_left = -3.97 -offset_top = -81.0 -offset_right = 4.06 -offset_bottom = 4.0 -size_flags_horizontal = 4 -texture = ExtResource("1_wyhk0") -script = ExtResource("2_pxsow") - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +[node name="AnimationPlayer" type="AnimationPlayer"] libraries = { "": SubResource("AnimationLibrary_ur3ij") } +script = ExtResource("1_43757") diff --git a/scenes/ui/animation_logo.tscn b/scenes/ui/animation_logo.tscn new file mode 100644 index 0000000..a443321 --- /dev/null +++ b/scenes/ui/animation_logo.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=4 format=3 uid="uid://yiu5npbi008a"] + +[ext_resource type="Animation" uid="uid://dvpvbkqok645q" path="res://scenes/ui/out-in.res" id="1_mcm38"] +[ext_resource type="Script" path="res://scenes/ui/animation.gd" id="1_urjt6"] + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_u5u2i"] +_data = { +"out-in": ExtResource("1_mcm38") +} + +[node name="AnimationPlayer" type="AnimationPlayer"] +libraries = { +"": SubResource("AnimationLibrary_u5u2i") +} +script = ExtResource("1_urjt6") diff --git a/scenes/ui/out-in.res b/scenes/ui/out-in.res new file mode 100644 index 0000000..d21b3be Binary files /dev/null and b/scenes/ui/out-in.res differ