fix merge conflict

This commit is contained in:
Ultrablob 2025-02-06 13:18:02 -05:00
commit 3661db1637
32 changed files with 840 additions and 37 deletions

View file

@ -9,7 +9,7 @@ var wave_count = start_wave
func _ready():
if start_wave != 0:
await get_tree().create_timer(5).timeout
await get_tree().create_timer(2).timeout
waves = waves.slice(start_wave)
spawn_loop()

View file

@ -9,8 +9,10 @@ func _ready():
func _physics_process(delta):
#global_rotation = $"..".linear_velocity.angle()
$ShapeCast2D.target_position = to_local($"..".linear_velocity * 1000)
points[1] = to_local($ShapeCast2D.get_collision_point(0))
if $ShapeCast2D.get_collider(0) != null and ["Player", "Shield" if target_shield else "None"].has($ShapeCast2D.get_collider(0).name):
points[1] = to_local($ShapeCast2D.get_collision_point(0))
visible = true
else:
visible = false

View file

@ -3,5 +3,8 @@ extends Node2D
var target: Node2D
func _process(delta):
if target:
look_at(target.global_position + target.linear_velocity)
if target and is_instance_valid(target):
if target.is_class("RigidBody2D"):
look_at(target.global_position + target.linear_velocity)
else:
look_at(target.global_position)

BIN
eart-bubble.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

34
eart-bubble.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://du4hmctktlccq"
path="res://.godot/imported/eart-bubble.png-2fc5e96b7339e253e89864691565e3b2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://eart-bubble.png"
dest_files=["res://.godot/imported/eart-bubble.png-2fc5e96b7339e253e89864691565e3b2.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

BIN
eart-shield-break.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dysewmpj8nvgx"
path="res://.godot/imported/eart-shield-break.png-3237feb9c3d0823340d07b2ee9703679.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://eart-shield-break.png"
dest_files=["res://.godot/imported/eart-shield-break.png-3237feb9c3d0823340d07b2ee9703679.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

BIN
eart-shield.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

34
eart-shield.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cc3nl13t7c4mj"
path="res://.godot/imported/eart-shield.png-3d03d60086a7a4ca3ffd8412d33b1963.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://eart-shield.png"
dest_files=["res://.godot/imported/eart-shield.png-3d03d60086a7a4ca3ffd8412d33b1963.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

BIN
eart-shoot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

34
eart-shoot.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ckrd5s78myn2"
path="res://.godot/imported/eart-shoot.png-1a3d97f9ee3df5e958c6e421bbc0a007.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://eart-shoot.png"
dest_files=["res://.godot/imported/eart-shoot.png-1a3d97f9ee3df5e958c6e421bbc0a007.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

30
eart.gd Normal file
View file

@ -0,0 +1,30 @@
extends StaticBody2D
func shoot():
$Turret.target = find_target()
if not $Turret.target:
return
$Turret/AnimatedSprite2D.play("shoot")
await $Turret/AnimatedSprite2D.animation_finished
$Turret/Gun.shoot()
$Turret/AnimatedSprite2D.play("default")
$Turret.target = find_target()
#$ShootTimer.start(1)
func find_target():
if len(get_tree().get_nodes_in_group("enemy")) <= 0:
print("Error! nothing to heal")
return null
var enemies = get_tree().get_nodes_in_group("enemy")
return enemies[randi_range(0, len(enemies)-1)]

BIN
eart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

34
eart.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bt6i05dav4ew5"
path="res://.godot/imported/eart.png-2bd558ee91f97d82f4e38d57e7eba5f3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://eart.png"
dest_files=["res://.godot/imported/eart.png-2bd558ee91f97d82f4e38d57e7eba5f3.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

12
eart.tres Normal file
View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="WaveEnemy" load_steps=4 format=3 uid="uid://c805aej5v7cvr"]
[ext_resource type="Script" path="res://wave_enemy.gd" id="1_0iu7m"]
[ext_resource type="PackedScene" uid="uid://cjvg8kxt7u5yk" path="res://eart.tscn" id="1_hy2xe"]
[ext_resource type="SpriteFrames" uid="uid://dh2kuw87g8lsx" path="res://ircle_portal.tres" id="2_nxpif"]
[resource]
script = ExtResource("1_0iu7m")
enemy = ExtResource("1_hy2xe")
boss = false
portal_texture = ExtResource("2_nxpif")
check_distance = 100

170
eart.tscn Normal file
View file

@ -0,0 +1,170 @@
[gd_scene load_steps=26 format=3 uid="uid://cjvg8kxt7u5yk"]
[ext_resource type="Script" path="res://eart.gd" id="1_xkxbf"]
[ext_resource type="Script" path="res://Turret.gd" id="3_jlwo0"]
[ext_resource type="Texture2D" uid="uid://bt6i05dav4ew5" path="res://eart.png" id="3_k6o1h"]
[ext_resource type="Texture2D" uid="uid://ckrd5s78myn2" path="res://eart-shoot.png" id="4_ry8nw"]
[ext_resource type="Script" path="res://Gun.gd" id="5_tefa8"]
[ext_resource type="PackedScene" uid="uid://dl02ccyielpnj" path="res://shield bullet.tscn" id="6_cxgsw"]
[ext_resource type="PackedScene" uid="uid://c3s8as813frjc" path="res://shield.tscn" id="7_w0oyy"]
[sub_resource type="AtlasTexture" id="AtlasTexture_x6kbk"]
atlas = ExtResource("3_k6o1h")
region = Rect2(0, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_uavfs"]
atlas = ExtResource("4_ry8nw")
region = Rect2(0, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_4kt48"]
atlas = ExtResource("4_ry8nw")
region = Rect2(128, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_m4kjs"]
atlas = ExtResource("4_ry8nw")
region = Rect2(256, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_80ps8"]
atlas = ExtResource("4_ry8nw")
region = Rect2(384, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_ocyed"]
atlas = ExtResource("4_ry8nw")
region = Rect2(512, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_festk"]
atlas = ExtResource("4_ry8nw")
region = Rect2(640, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_7qs7e"]
atlas = ExtResource("4_ry8nw")
region = Rect2(768, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_2lsh6"]
atlas = ExtResource("4_ry8nw")
region = Rect2(896, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_ude0u"]
atlas = ExtResource("4_ry8nw")
region = Rect2(1024, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_u4tdc"]
atlas = ExtResource("4_ry8nw")
region = Rect2(1152, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_dcqkk"]
atlas = ExtResource("4_ry8nw")
region = Rect2(1280, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_2ovns"]
atlas = ExtResource("4_ry8nw")
region = Rect2(1408, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_n3uow"]
atlas = ExtResource("4_ry8nw")
region = Rect2(1536, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_wksfy"]
atlas = ExtResource("4_ry8nw")
region = Rect2(1664, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_v8s4u"]
atlas = ExtResource("4_ry8nw")
region = Rect2(1792, 0, 128, 128)
[sub_resource type="SpriteFrames" id="SpriteFrames_1fj5a"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_x6kbk")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_uavfs")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4kt48")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_m4kjs")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_80ps8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ocyed")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_festk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7qs7e")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2lsh6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ude0u")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_u4tdc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dcqkk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2ovns")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_n3uow")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wksfy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_v8s4u")
}],
"loop": false,
"name": &"shoot",
"speed": 12.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_03ifk"]
radius = 44.1475
[node name="Eart" type="StaticBody2D" groups=["destructible"]]
script = ExtResource("1_xkxbf")
[node name="ShootTimer" type="Timer" parent="."]
autostart = true
[node name="Turret" type="Node2D" parent="."]
script = ExtResource("3_jlwo0")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Turret"]
position = Vector2(14, 0)
rotation = -1.5708
sprite_frames = SubResource("SpriteFrames_1fj5a")
animation = &"shoot"
autoplay = "default"
[node name="Gun" type="Marker2D" parent="Turret"]
position = Vector2(106, 0)
script = ExtResource("5_tefa8")
bullet = ExtResource("6_cxgsw")
bullet_speed = 300
[node name="RayCast2D" type="RayCast2D" parent="Turret"]
target_position = Vector2(1000, 0)
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_03ifk")
[node name="Shield" parent="." instance=ExtResource("7_w0oyy")]
scale = Vector2(2, 2)
[connection signal="timeout" from="ShootTimer" to="." method="shoot"]

View file

@ -33,13 +33,13 @@ animations = [{
}],
"loop": true,
"name": &"default",
"speed": 5.0
"speed": 3.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_03ifk"]
radius = 36.0139
[node name="Eptagon" type="StaticBody2D" groups=["destructible"]]
[node name="Eptagon" type="StaticBody2D" groups=["destructible", "enemy"]]
script = ExtResource("1_d0pdl")
[node name="Sprite2D" type="Sprite2D" parent="."]
@ -60,7 +60,6 @@ autoplay = "default"
position = Vector2(56, 0)
script = ExtResource("2_sea5o")
bullet = ExtResource("4_cyd7j")
bullet_speed = 750
[node name="Collider" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_03ifk")

View file

@ -155,5 +155,8 @@ shape = SubResource("CircleShape2D_yns8h")
[node name="LaserFX" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_tkxjf")
[node name="ShieldMarker" type="Marker2D" parent="."]
scale = Vector2(6, 6)
[connection signal="timeout" from="Line2D/VisibleTimer" to="Line2D" method="set_transparent"]
[connection signal="timeout" from="Timer" to="." method="fire_laser"]

View file

@ -3,6 +3,10 @@ var config = ConfigFile.new()
# Called when the node enters the scene tree for the first time.
func _init():
if OS.is_debug_build():
Engine.set_time_scale(1)
if config.load("user://settings.cfg") == OK:
var player = load(config.get_value("gameplay", "class", "res://player-row.tscn")).instantiate()
player.position = Vector2(1920/2, 1080/2)

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=116 format=3 uid="uid://bmd4m7lqj4v0x"]
[gd_scene load_steps=117 format=3 uid="uid://bmd4m7lqj4v0x"]
[ext_resource type="Script" path="res://main.gd" id="1_3dydx"]
[ext_resource type="Script" path="res://Spawner.gd" id="1_ifu8g"]
@ -13,6 +13,7 @@
[ext_resource type="Script" path="res://wave_enemy.gd" id="7_54h7d"]
[ext_resource type="Texture2D" uid="uid://cwquv3mq5kk1d" path="res://countdown-spritesheet.png" id="8_e1eub"]
[ext_resource type="Resource" uid="uid://ba01r62bwm6av" path="res://eptagon_enemy.tres" id="9_q67ak"]
[ext_resource type="Resource" path="res://eart.tres" id="10_jib8h"]
[ext_resource type="AudioStream" uid="uid://dn65uapn0wsok" path="res://impactMetal_002.ogg" id="11_acuni"]
[ext_resource type="Script" path="res://CollisionCheck.gd" id="11_ryeyk"]
[ext_resource type="FontFile" uid="uid://bnguin7bsyx6e" path="res://Kenney Future.ttf" id="11_s4q6p"]
@ -112,23 +113,23 @@ wait_for_killed = true
[sub_resource type="Resource" id="Resource_61v84"]
script = ExtResource("4_um0x7")
enemies = Array[ExtResource("7_54h7d")]([ExtResource("9_q67ak")])
quantities = Array[int]([1])
spawning_duration = 1.0
enemies = Array[ExtResource("7_54h7d")]([ExtResource("10_jib8h"), ExtResource("3_xmk5u")])
quantities = Array[int]([1, 2])
spawning_duration = 3.0
wait = 5.0
wait_for_killed = true
[sub_resource type="Resource" id="Resource_82qld"]
script = ExtResource("4_um0x7")
enemies = Array[ExtResource("7_54h7d")]([ExtResource("3_xmk5u"), ExtResource("5_xdrk0"), ExtResource("5_e24vf")])
quantities = Array[int]([10, 10, 10])
enemies = Array[ExtResource("7_54h7d")]([ExtResource("3_xmk5u"), ExtResource("5_xdrk0"), ExtResource("5_e24vf"), ExtResource("10_jib8h")])
quantities = Array[int]([10, 10, 10, 4])
spawning_duration = 20.0
wait = 2.0
wait_for_killed = true
[sub_resource type="Resource" id="Resource_2j32b"]
script = ExtResource("4_um0x7")
enemies = Array[ExtResource("7_54h7d")]([ExtResource("5_e24vf"), ExtResource("9_q67ak")])
enemies = Array[ExtResource("7_54h7d")]([ExtResource("5_xdrk0"), ExtResource("9_q67ak")])
quantities = Array[int]([2, 2])
spawning_duration = 10.0
wait = 3.0

View file

@ -161,7 +161,6 @@ text = "Movement "
layout_mode = 2
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 54
selected = 0
item_count = 2
popup/item_0/text = "Relative"
popup/item_1/text = "Absolute"
@ -179,7 +178,6 @@ text = "CLASS"
layout_mode = 2
theme_override_fonts/font = ExtResource("4_ybv7t")
theme_override_font_sizes/font_size = 54
selected = 0
item_count = 3
popup/item_0/text = "Row"
popup/item_1/text = "Ite"

View file

@ -205,3 +205,5 @@ color_ramp = SubResource("Gradient_urfxb")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="3"]
rotation = -1.5708
shape = SubResource("CapsuleShape2D_bf2qx")
[node name="ShieldMarker" type="Marker2D" parent="." index="4"]

View file

@ -276,3 +276,7 @@ collision_mask = 3
[node name="LaserFX" type="AudioStreamPlayer2D" parent="." index="5"]
stream = ExtResource("9_thl05")
bus = &"SFX"
[node name="ShieldMarker" type="Marker2D" parent="." index="6"]
position = Vector2(10.5, 0)
scale = Vector2(2, 2)

View file

@ -24,14 +24,14 @@ func _input(event):
if num_quares >= max_quares:
notifier.notify("All Quares in Use!")
return
for child in $"../".get_node("%Ability").get_children():
if child.value == 0 and not child.animating:
child.value = 100
break
if not $"../CollisionCheck".is_clear(get_global_mouse_position(), 60):
$"../CollisionCheck".flash()
notifier.notify("Too Close!")
return
for child in $"../".get_node("%Ability").get_children():
if child.value == 0 and not child.animating:
child.value = 100
num_quares += 1
var new_quare = quare.instantiate()
new_quare.position = get_global_mouse_position()

View file

@ -205,3 +205,6 @@ bus = &"SFX"
[node name="ExagonFX" type="AudioStreamPlayer2D" parent="." index="4"]
stream = ExtResource("4_lwgj5")
bus = &"SFX"
[node name="ShieldMarker" type="Marker2D" parent="." index="5"]
scale = Vector2(1.5, 1.5)

4
player-shield.gd Normal file
View file

@ -0,0 +1,4 @@
extends CollisionShape2D
func destroy():
$AnimatedSprite2D.play("die")

125
player-shield.tscn Normal file
View file

@ -0,0 +1,125 @@
[gd_scene load_steps=19 format=3 uid="uid://b11jmnjkk6ibm"]
[ext_resource type="Script" path="res://player-shield.gd" id="1_wq4q6"]
[ext_resource type="Texture2D" uid="uid://cc3nl13t7c4mj" path="res://eart-shield.png" id="2_iu5tn"]
[ext_resource type="Texture2D" uid="uid://dysewmpj8nvgx" path="res://eart-shield-break.png" id="3_yw3j3"]
[sub_resource type="CircleShape2D" id="CircleShape2D_0lade"]
radius = 24.3425
[sub_resource type="AtlasTexture" id="AtlasTexture_mcb3o"]
atlas = ExtResource("2_iu5tn")
region = Rect2(0, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_l8lnp"]
atlas = ExtResource("2_iu5tn")
region = Rect2(64, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_so4um"]
atlas = ExtResource("2_iu5tn")
region = Rect2(128, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_sel7y"]
atlas = ExtResource("2_iu5tn")
region = Rect2(192, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_iumxh"]
atlas = ExtResource("2_iu5tn")
region = Rect2(256, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_jb6hd"]
atlas = ExtResource("2_iu5tn")
region = Rect2(320, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_5xoy6"]
atlas = ExtResource("2_iu5tn")
region = Rect2(384, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_a5ids"]
atlas = ExtResource("3_yw3j3")
region = Rect2(0, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_x2842"]
atlas = ExtResource("3_yw3j3")
region = Rect2(64, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_ckp3b"]
atlas = ExtResource("3_yw3j3")
region = Rect2(128, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_b6w7a"]
atlas = ExtResource("3_yw3j3")
region = Rect2(192, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_m7ilu"]
atlas = ExtResource("3_yw3j3")
region = Rect2(256, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_w1mec"]
atlas = ExtResource("3_yw3j3")
region = Rect2(320, 0, 64, 64)
[sub_resource type="SpriteFrames" id="SpriteFrames_gcmwu"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_mcb3o")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_l8lnp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_so4um")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_sel7y")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_iumxh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jb6hd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5xoy6")
}],
"loop": true,
"name": &"default",
"speed": 7.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_a5ids")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_x2842")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ckp3b")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_b6w7a")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_m7ilu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_w1mec")
}],
"loop": false,
"name": &"die",
"speed": 7.0
}]
[node name="Shield" type="CollisionShape2D" groups=["destructible"]]
scale = Vector2(3, 3)
shape = SubResource("CircleShape2D_0lade")
script = ExtResource("1_wq4q6")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_gcmwu")
autoplay = "default"
frame = 4
frame_progress = 0.495833
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="queue_free"]

View file

@ -27,10 +27,10 @@ func _physics_process(delta):
return
var move_input = Input.get_axis("down", "up")
var side_input = Input.get_axis("right", "left")
if move_input > 0 and not moving:
if move_input != 0 or side_input != 0:
moving = true
update_animation()
elif move_input <= 0 and moving:
else:
moving = false
update_animation()
@ -40,6 +40,9 @@ func _physics_process(delta):
apply_central_force(transform.y * side_input * speed / -2 + transform.x * move_input * speed * linear_damp)
func destroy():
if has_node("Shield"):
$Shield.destroy()
return
$DeathFX.play()
get_tree().paused = true
$"../GameOver".visible = true

View file

@ -12,7 +12,7 @@ config_version=5
config/name="Countdown"
run/main_scene="res://main_menu.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/features=PackedStringArray("4.2", "GL Compatibility")
run/max_fps=60
config/icon="res://icon.svg"
@ -28,62 +28,67 @@ window/vsync/vsync_mode=2
version_control/plugin_name="GitPlugin"
version_control/autoload_on_startup=true
[global_group]
destructible="Destructible Objects"
enemy="Enemies"
[input]
up={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null)
]
}
down={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
]
}
left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
]
}
right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
]
}
restart={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":114,"location":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":114,"echo":false,"script":null)
]
}
jump={
"deadzone": 0.5,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(130, 40),"global_position":Vector2(138, 120),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
]
}
quare={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":113,"location":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":113,"echo":false,"script":null)
]
}
exagon={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"echo":false,"script":null)
]
}
quit={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null)
]
}
shoot={
"deadzone": 0.5,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(91, 32),"global_position":Vector2(99, 112),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
]
}

92
shield bullet.tscn Normal file
View file

@ -0,0 +1,92 @@
[gd_scene load_steps=13 format=3 uid="uid://dl02ccyielpnj"]
[ext_resource type="Script" path="res://shield_bullet.gd" id="1_dsvm1"]
[ext_resource type="Texture2D" uid="uid://du4hmctktlccq" path="res://eart-bubble.png" id="2_ledl3"]
[ext_resource type="Texture2D" uid="uid://djfjdlri5xdkn" path="res://dotted line.png" id="3_jaepw"]
[ext_resource type="Script" path="res://TrajectoryDisplay.gd" id="4_fyeym"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_xnhwp"]
friction = 0.0
bounce = 1.0
[sub_resource type="CircleShape2D" id="CircleShape2D_b5cca"]
radius = 13.0
[sub_resource type="AtlasTexture" id="AtlasTexture_qjm3j"]
atlas = ExtResource("2_ledl3")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_rrdre"]
atlas = ExtResource("2_ledl3")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_ghx8d"]
atlas = ExtResource("2_ledl3")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_ch73m"]
atlas = ExtResource("2_ledl3")
region = Rect2(96, 0, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_pacu6"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_qjm3j")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rrdre")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ghx8d")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ch73m")
}],
"loop": true,
"name": &"default",
"speed": 7.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_13gk7"]
radius = 30.0
[node name="Bullet" type="RigidBody2D" groups=["bullet"]]
collision_layer = 2
physics_material_override = SubResource("PhysicsMaterial_xnhwp")
gravity_scale = 1.66533e-16
max_contacts_reported = 1
contact_monitor = true
linear_velocity = Vector2(2.08165e-12, 2.08165e-12)
script = ExtResource("1_dsvm1")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 1)
rotation = -1.5708
shape = SubResource("CircleShape2D_b5cca")
[node name="Sprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
position = Vector2(11, -6)
rotation = 1.5708
sprite_frames = SubResource("SpriteFrames_pacu6")
autoplay = "default"
offset = Vector2(7.05637, 10.7826)
[node name="TrajectoryDisplay" type="Line2D" parent="."]
visible = false
z_index = -1
texture_repeat = 2
position = Vector2(-2, 0)
points = PackedVector2Array(0, 0, 100, 0)
width = 50.0
default_color = Color(0.909804, 0.717647, 0.337255, 0.529412)
texture = ExtResource("3_jaepw")
texture_mode = 1
script = ExtResource("4_fyeym")
[node name="ShapeCast2D" type="ShapeCast2D" parent="TrajectoryDisplay"]
shape = SubResource("CircleShape2D_13gk7")
target_position = Vector2(500, 2.08165e-12)
[connection signal="body_entered" from="." to="." method="hit"]

128
shield.tscn Normal file
View file

@ -0,0 +1,128 @@
[gd_scene load_steps=19 format=3 uid="uid://c3s8as813frjc"]
[ext_resource type="Script" path="res://shield.gd" id="1_ni0ln"]
[ext_resource type="Texture2D" uid="uid://cc3nl13t7c4mj" path="res://eart-shield.png" id="2_2bt8h"]
[ext_resource type="Texture2D" uid="uid://dysewmpj8nvgx" path="res://eart-shield-break.png" id="3_1tta6"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mcb3o"]
atlas = ExtResource("2_2bt8h")
region = Rect2(0, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_l8lnp"]
atlas = ExtResource("2_2bt8h")
region = Rect2(64, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_so4um"]
atlas = ExtResource("2_2bt8h")
region = Rect2(128, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_sel7y"]
atlas = ExtResource("2_2bt8h")
region = Rect2(192, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_iumxh"]
atlas = ExtResource("2_2bt8h")
region = Rect2(256, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_jb6hd"]
atlas = ExtResource("2_2bt8h")
region = Rect2(320, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_5xoy6"]
atlas = ExtResource("2_2bt8h")
region = Rect2(384, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_a5ids"]
atlas = ExtResource("3_1tta6")
region = Rect2(0, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_x2842"]
atlas = ExtResource("3_1tta6")
region = Rect2(64, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_ckp3b"]
atlas = ExtResource("3_1tta6")
region = Rect2(128, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_b6w7a"]
atlas = ExtResource("3_1tta6")
region = Rect2(192, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_m7ilu"]
atlas = ExtResource("3_1tta6")
region = Rect2(256, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_w1mec"]
atlas = ExtResource("3_1tta6")
region = Rect2(320, 0, 64, 64)
[sub_resource type="SpriteFrames" id="SpriteFrames_gcmwu"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_mcb3o")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_l8lnp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_so4um")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_sel7y")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_iumxh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jb6hd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5xoy6")
}],
"loop": true,
"name": &"default",
"speed": 7.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_a5ids")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_x2842")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ckp3b")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_b6w7a")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_m7ilu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_w1mec")
}],
"loop": false,
"name": &"die",
"speed": 7.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_00lvq"]
radius = 25.1794
[node name="Shield" type="StaticBody2D" groups=["destructible"]]
scale = Vector2(3.5, 3.5)
script = ExtResource("1_ni0ln")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_gcmwu")
animation = &"die"
autoplay = "default"
[node name="Collider" type="CollisionShape2D" parent="."]
position = Vector2(-1, 0)
shape = SubResource("CircleShape2D_00lvq")
disabled = true
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="queue_free"]

45
shield_bullet.gd Normal file
View file

@ -0,0 +1,45 @@
extends RigidBody2D
@onready var player = $"../Player"
var shield_scene = preload("res://shield.tscn")
var player_shield = preload("res://player-shield.tscn")
func _physics_process(delta):
rotation = linear_velocity.angle()
#if linear_velocity.length() < 1100:
# apply_central_force((global_position - player.global_position).normalized() * -200)
func hit(body):
if body.is_in_group("destructible") and body.name != "Shield":
var shield = shield_scene.instantiate()
if body.has_node("Shield"):
queue_free()
return
if body.name == "Player":
shield = player_shield.instantiate()
var marker = body.get_node("ShieldMarker")
shield.position = marker.position
shield.scale = marker.scale
body.add_child(shield)
elif body.has_node("ShieldMarker"):
if body.get_node("ShieldMarker").has_node("Shield"):
queue_free()
return
shield.scale = Vector2.ONE
body.get_node("ShieldMarker").add_child(shield)
else:
body.add_child(shield)
shield.position = Vector2.ZERO
queue_free()
else:
queue_free()