Merge branch 'main' of https://gamejam.fachschaft.info/Florian/The_Dark_Side_of_Earth
This commit is contained in:
commit
54d183c245
8 changed files with 99 additions and 55 deletions
|
|
@ -75,13 +75,13 @@ func destroy_below():
|
||||||
func wave():
|
func wave():
|
||||||
var angle = atan2(player.position.y, player.position.x)
|
var angle = atan2(player.position.y, player.position.x)
|
||||||
var dir = randi_range(0, 1) * 2 - 1
|
var dir = randi_range(0, 1) * 2 - 1
|
||||||
%Water.create_tsunami(angle - dir*TAU/30, dir)
|
get_tree().get_root().get_node("main/Water").create_tsunami(angle - dir*TAU/30, dir)
|
||||||
await get_tree().create_timer(4).timeout
|
await get_tree().create_timer(4).timeout
|
||||||
attack_ready = true
|
attack_ready = true
|
||||||
|
|
||||||
func water_rise():
|
func water_rise():
|
||||||
%Water.rise_water()
|
get_tree().get_root().get_node("main/Water").rise_water()
|
||||||
await get_tree().create_timer(4).timeout
|
await get_tree().create_timer(5).timeout
|
||||||
attack_ready = true
|
attack_ready = true
|
||||||
|
|
||||||
func splash():
|
func splash():
|
||||||
|
|
@ -91,3 +91,6 @@ func splash():
|
||||||
blob_instance.rotation = randf_range(0, TAU)
|
blob_instance.rotation = randf_range(0, TAU)
|
||||||
await get_tree().create_timer(5).timeout
|
await get_tree().create_timer(5).timeout
|
||||||
attack_ready = true
|
attack_ready = true
|
||||||
|
|
||||||
|
func die():
|
||||||
|
queue_free()
|
||||||
|
|
|
||||||
|
|
@ -58,3 +58,5 @@ collision_mask = 10
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DestructionChecker"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="DestructionChecker"]
|
||||||
position = Vector2(0, 200)
|
position = Vector2(0, 200)
|
||||||
shape = SubResource("RectangleShape2D_lnbgr")
|
shape = SubResource("RectangleShape2D_lnbgr")
|
||||||
|
|
||||||
|
[connection signal="died" from="EnemyHurtbox" to="." method="die"]
|
||||||
|
|
|
||||||
11
enemies/boss/boss_spawner.gd
Normal file
11
enemies/boss/boss_spawner.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
@export var boss : PackedScene
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func _on_water_water_reached_max_height() -> void:
|
||||||
|
var node = boss.instantiate()
|
||||||
|
add_sibling(node)
|
||||||
|
node.position = %Player.position + %Player.earth_aligner.local_from_global(Vector2.UP) * 1000;
|
||||||
|
queue_free()
|
||||||
1
enemies/boss/boss_spawner.gd.uid
Normal file
1
enemies/boss/boss_spawner.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://cpaskpj67pnaj
|
||||||
50
main.tscn
50
main.tscn
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=11 format=3 uid="uid://cxo6bq26huau7"]
|
[gd_scene load_steps=12 format=3 uid="uid://cxo6bq26huau7"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"]
|
[ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d3fpq76anm4t7" path="res://world/Background Prototype/Background prototype.png" id="3_kek77"]
|
[ext_resource type="Texture2D" uid="uid://d3fpq76anm4t7" path="res://world/Background Prototype/Background prototype.png" id="3_kek77"]
|
||||||
|
|
@ -8,8 +8,9 @@
|
||||||
[ext_resource type="PackedScene" uid="uid://cjsrtswk4vgf2" path="res://ui/healthbar/healthbar.tscn" id="6_7mycd"]
|
[ext_resource type="PackedScene" uid="uid://cjsrtswk4vgf2" path="res://ui/healthbar/healthbar.tscn" id="6_7mycd"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dpdn2php3ydsv" path="res://ui/death_screen/death_screen.tscn" id="7_5vw27"]
|
[ext_resource type="PackedScene" uid="uid://dpdn2php3ydsv" path="res://ui/death_screen/death_screen.tscn" id="7_5vw27"]
|
||||||
[ext_resource type="Script" uid="uid://3k6r3jnko4hg" path="res://utils/show_fps.gd" id="8_5vw27"]
|
[ext_resource type="Script" uid="uid://3k6r3jnko4hg" path="res://utils/show_fps.gd" id="8_5vw27"]
|
||||||
[ext_resource type="PackedScene" uid="uid://b62xcg0dd3vct" path="res://enemies/leech/leech.tscn" id="9_kek77"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ca5ndobertnp4" path="res://water/water.tscn" id="10_4c57u"]
|
[ext_resource type="PackedScene" uid="uid://ca5ndobertnp4" path="res://water/water.tscn" id="10_4c57u"]
|
||||||
|
[ext_resource type="Script" uid="uid://cpaskpj67pnaj" path="res://enemies/boss/boss_spawner.gd" id="10_efxa6"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cpe4s6vsn0ujd" path="res://enemies/boss/boss.tscn" id="11_efxa6"]
|
||||||
|
|
||||||
[node name="main" type="Node2D"]
|
[node name="main" type="Node2D"]
|
||||||
|
|
||||||
|
|
@ -18,45 +19,38 @@ unique_name_in_owner = true
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("2_1bvp3")]
|
[node name="Player" parent="." instance=ExtResource("2_1bvp3")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
position = Vector2(709, -2980)
|
position = Vector2(578, -3017)
|
||||||
scale = Vector2(3, 3)
|
scale = Vector2(3, 3)
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="Player"]
|
[node name="Camera2D" type="Camera2D" parent="Player"]
|
||||||
position = Vector2(0, -50)
|
position = Vector2(0, -50)
|
||||||
ignore_rotation = false
|
ignore_rotation = false
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="Player"]
|
|
||||||
visible = false
|
|
||||||
z_index = -20
|
|
||||||
position = Vector2(0, -50)
|
|
||||||
scale = Vector2(0.7, 0.7)
|
|
||||||
texture = ExtResource("3_kek77")
|
|
||||||
|
|
||||||
[node name="Debug_Camera" type="Camera2D" parent="."]
|
[node name="Debug_Camera" type="Camera2D" parent="."]
|
||||||
scale = Vector2(41.02, 41.02)
|
scale = Vector2(41.02, 41.02)
|
||||||
zoom = Vector2(0.12, 0.12)
|
zoom = Vector2(0.12, 0.12)
|
||||||
|
|
||||||
[node name="Building Generator" type="Node" parent="."]
|
[node name="Building Generator" type="Node" parent="."]
|
||||||
script = ExtResource("4_1bvp3")
|
script = ExtResource("4_1bvp3")
|
||||||
initial_buildings = 10
|
initial_buildings = 100
|
||||||
|
|
||||||
[node name="Timer" type="Timer" parent="Building Generator"]
|
[node name="Timer" type="Timer" parent="Building Generator"]
|
||||||
wait_time = 3.0
|
wait_time = 3.0
|
||||||
autostart = true
|
autostart = true
|
||||||
|
|
||||||
[node name="CanvasLayer1" type="CanvasLayer" parent="."]
|
[node name="UIOverlay" type="CanvasLayer" parent="."]
|
||||||
|
|
||||||
[node name="Healthbar" parent="CanvasLayer1" instance=ExtResource("6_7mycd")]
|
[node name="Healthbar" parent="UIOverlay" instance=ExtResource("6_7mycd")]
|
||||||
offset_right = 96.0
|
offset_right = 96.0
|
||||||
offset_bottom = 96.0
|
offset_bottom = 96.0
|
||||||
|
|
||||||
[node name="ItemUI" parent="CanvasLayer1" node_paths=PackedStringArray("player") instance=ExtResource("6_4c57u")]
|
[node name="ItemUI" parent="UIOverlay" node_paths=PackedStringArray("player") instance=ExtResource("6_4c57u")]
|
||||||
player = NodePath("../../Player")
|
player = NodePath("../../Player")
|
||||||
|
|
||||||
[node name="DeathScreen" parent="CanvasLayer1" instance=ExtResource("7_5vw27")]
|
[node name="DeathScreen" parent="UIOverlay" instance=ExtResource("7_5vw27")]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="FPS" type="Label" parent="CanvasLayer1"]
|
[node name="FPS" type="Label" parent="UIOverlay"]
|
||||||
anchors_preset = 1
|
anchors_preset = 1
|
||||||
anchor_left = 1.0
|
anchor_left = 1.0
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
|
|
@ -65,19 +59,14 @@ offset_bottom = 23.0
|
||||||
grow_horizontal = 0
|
grow_horizontal = 0
|
||||||
script = ExtResource("8_5vw27")
|
script = ExtResource("8_5vw27")
|
||||||
|
|
||||||
[node name="Leech" parent="." instance=ExtResource("9_kek77")]
|
|
||||||
position = Vector2(0, -3015)
|
|
||||||
|
|
||||||
[node name="Water" parent="." instance=ExtResource("10_4c57u")]
|
[node name="Water" parent="." instance=ExtResource("10_4c57u")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
z_index = 15
|
z_index = 15
|
||||||
|
|
||||||
[node name="CanvasLayer-1" type="CanvasLayer" parent="."]
|
[node name="Background" type="CanvasLayer" parent="."]
|
||||||
layer = -1
|
layer = -1
|
||||||
visible = false
|
|
||||||
|
|
||||||
[node name="ColorRect" type="TextureRect" parent="CanvasLayer-1"]
|
[node name="ColorRect" type="TextureRect" parent="Background"]
|
||||||
visible = false
|
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
|
|
@ -85,9 +74,14 @@ grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
texture = ExtResource("3_kek77")
|
texture = ExtResource("3_kek77")
|
||||||
|
|
||||||
[connection signal="active_item_changed" from="Player" to="CanvasLayer1/ItemUI" method="_on_player_active_item_changed"]
|
[node name="BossSpawner" type="Node" parent="."]
|
||||||
[connection signal="health_changed" from="Player" to="CanvasLayer1/Healthbar" method="_on_player_health_changed"]
|
script = ExtResource("10_efxa6")
|
||||||
[connection signal="max_hp_changed" from="Player" to="CanvasLayer1/Healthbar" method="_on_player_max_hp_changed"]
|
boss = ExtResource("11_efxa6")
|
||||||
[connection signal="player_died" from="Player" to="CanvasLayer1/DeathScreen" method="_on_player_player_died"]
|
|
||||||
|
[connection signal="active_item_changed" from="Player" to="UIOverlay/ItemUI" method="_on_player_active_item_changed"]
|
||||||
|
[connection signal="health_changed" from="Player" to="UIOverlay/Healthbar" method="_on_player_health_changed"]
|
||||||
|
[connection signal="max_hp_changed" from="Player" to="UIOverlay/Healthbar" method="_on_player_max_hp_changed"]
|
||||||
|
[connection signal="player_died" from="Player" to="UIOverlay/DeathScreen" method="_on_player_player_died"]
|
||||||
[connection signal="timeout" from="Building Generator/Timer" to="Building Generator" method="_on_timer_timeout"]
|
[connection signal="timeout" from="Building Generator/Timer" to="Building Generator" method="_on_timer_timeout"]
|
||||||
[connection signal="visibility_changed" from="CanvasLayer1/DeathScreen" to="Player" method="_on_death_screen_visibility_changed"]
|
[connection signal="visibility_changed" from="UIOverlay/DeathScreen" to="Player" method="_on_death_screen_visibility_changed"]
|
||||||
|
[connection signal="water_reached_max_height" from="Water" to="BossSpawner" method="_on_water_water_reached_max_height"]
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ func _on_button_quit_pressed() -> void:
|
||||||
|
|
||||||
func _on_button_main_menu_pressed() -> void:
|
func _on_button_main_menu_pressed() -> void:
|
||||||
Engine.time_scale = 1.
|
Engine.time_scale = 1.
|
||||||
get_tree().change_scene_to_file("res://main_menu/main_menu.tscn")
|
get_tree().change_scene_to_file("res://ui/main_menu/main_menu.tscn")
|
||||||
|
|
||||||
func _on_player_player_died() -> void:
|
func _on_player_player_died() -> void:
|
||||||
visible = true
|
visible = true
|
||||||
|
|
|
||||||
|
|
@ -88,16 +88,9 @@ func update_shader():
|
||||||
tsunami_size = tsunami_size
|
tsunami_size = tsunami_size
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
print(name)
|
|
||||||
update_shader()
|
update_shader()
|
||||||
radius_base = rise_from
|
radius_base = rise_from
|
||||||
auto_rise = false
|
|
||||||
radius_base = 2950;
|
|
||||||
|
|
||||||
#create_tsunami(4.712, 1);
|
|
||||||
await get_tree().create_timer(3).timeout
|
|
||||||
#create_tsunami(4.712, 1);
|
|
||||||
rise_water()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -126,12 +119,14 @@ func create_tsunami(angle : float, dir : int):
|
||||||
$Tsunami.play("tsunami")
|
$Tsunami.play("tsunami")
|
||||||
|
|
||||||
func rise_water():
|
func rise_water():
|
||||||
|
await get_tree().create_timer(.03).timeout
|
||||||
auto_rise = false
|
auto_rise = false
|
||||||
$ParticleContainer.scale = Vector2.ONE * radius/3000
|
$ParticleContainer.scale = Vector2.ONE * radius/3000
|
||||||
var pos = player.position
|
var pos = player.position
|
||||||
var angle = atan2(pos.y, pos.x)
|
var angle = atan2(pos.y, pos.x)
|
||||||
$ParticleContainer.rotation = angle + PI/2
|
$ParticleContainer.rotation = angle + PI/2
|
||||||
|
$ParticleContainer.position += Vector2.ONE
|
||||||
|
$WaterRise.play("water_rise")
|
||||||
await $WaterRise.animation_finished
|
await $WaterRise.animation_finished
|
||||||
radius_base = radius_base + animation_height
|
radius_base = radius_base + animation_height
|
||||||
animation_height = 0
|
animation_height = 0
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue