This commit is contained in:
parent
90256944ab
commit
42e6881453
12 changed files with 80 additions and 19 deletions
|
@ -8,7 +8,7 @@ func hit(body):
|
|||
body.destroy()
|
||||
else:
|
||||
body.queue_free()
|
||||
spawn_explosion()
|
||||
spawn_explosion()
|
||||
queue_free()
|
||||
if body.name == "Border":
|
||||
queue_free()
|
||||
|
|
|
@ -56,7 +56,7 @@ func spawn(item: WaveEnemy):
|
|||
print("Spawning Boss!")
|
||||
spawn_loc = Vector2(1920/2, 1080/2)
|
||||
else:
|
||||
for i in range(100):
|
||||
for i in range(1000):
|
||||
var test_pos = Vector2(randf(), randf()) * Vector2(1920, 1080)
|
||||
if not $"../CollisionCheck".is_clear(test_pos, item.check_distance):
|
||||
continue
|
||||
|
|
|
@ -21,6 +21,7 @@ func hit(body):
|
|||
queue_free()
|
||||
else:
|
||||
bounces += 1
|
||||
$Sprite2D.play("depleted")
|
||||
#print(bounces)
|
||||
|
||||
if bounces >= 2:
|
||||
|
|
24
bullet.tscn
24
bullet.tscn
|
@ -20,11 +20,11 @@ region = Rect2(0, 0, 40, 40)
|
|||
atlas = ExtResource("2_unua3")
|
||||
region = Rect2(40, 0, 40, 40)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_u3ov1"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m7c0a"]
|
||||
atlas = ExtResource("2_unua3")
|
||||
region = Rect2(80, 0, 40, 40)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ia1sw"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uq6kd"]
|
||||
atlas = ExtResource("2_unua3")
|
||||
region = Rect2(120, 0, 40, 40)
|
||||
|
||||
|
@ -36,16 +36,21 @@ animations = [{
|
|||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ldqff")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_u3ov1")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ia1sw")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 7.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_m7c0a")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_uq6kd")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"depleted",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_13gk7"]
|
||||
|
@ -70,7 +75,10 @@ position = Vector2(-0.0234375, -0.00781251)
|
|||
rotation = 1.5708
|
||||
scale = Vector2(4, 4)
|
||||
sprite_frames = SubResource("SpriteFrames_pacu6")
|
||||
animation = &"depleted"
|
||||
autoplay = "default"
|
||||
frame = 1
|
||||
frame_progress = 0.323082
|
||||
offset = Vector2(7.05637, 10.7826)
|
||||
|
||||
[node name="TrajectoryDisplay" type="Line2D" parent="."]
|
||||
|
|
|
@ -9,4 +9,4 @@ script = ExtResource("1_0iu7m")
|
|||
enemy = ExtResource("1_hy2xe")
|
||||
boss = false
|
||||
portal_texture = ExtResource("2_nxpif")
|
||||
check_distance = 100
|
||||
check_distance = 150
|
||||
|
|
|
@ -100,4 +100,7 @@ target_shield = true
|
|||
shape = SubResource("CircleShape2D_eo18f")
|
||||
target_position = Vector2(2.08165e-12, 500)
|
||||
|
||||
[node name="ShieldMarker" type="Marker2D" parent="."]
|
||||
scale = Vector2(1.5, 1.5)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="hit"]
|
||||
|
|
|
@ -9,4 +9,4 @@ script = ExtResource("3_t4kaf")
|
|||
enemy = ExtResource("1_mfudl")
|
||||
boss = false
|
||||
portal_texture = ExtResource("2_2xm8e")
|
||||
check_distance = 250
|
||||
check_distance = 200
|
||||
|
|
|
@ -64,4 +64,7 @@ bullet = ExtResource("4_cyd7j")
|
|||
[node name="Collider" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_03ifk")
|
||||
|
||||
[node name="ShieldMarker" type="Marker2D" parent="."]
|
||||
scale = Vector2(2, 2)
|
||||
|
||||
[connection signal="animation_looped" from="Turret/AnimatedSprite2D" to="Turret/Gun" method="shoot"]
|
||||
|
|
2
main.gd
2
main.gd
|
@ -5,7 +5,7 @@ var config = ConfigFile.new()
|
|||
func _init():
|
||||
|
||||
if OS.is_debug_build():
|
||||
Engine.set_time_scale(1)
|
||||
Engine.set_time_scale(0.75)
|
||||
|
||||
if config.load("user://settings.cfg") == OK:
|
||||
var player = load(config.get_value("gameplay", "class", "res://player-row.tscn")).instantiate()
|
||||
|
|
33
main.tscn
33
main.tscn
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=117 format=3 uid="uid://bmd4m7lqj4v0x"]
|
||||
[gd_scene load_steps=120 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"]
|
||||
|
@ -129,12 +129,36 @@ wait_for_killed = true
|
|||
|
||||
[sub_resource type="Resource" id="Resource_2j32b"]
|
||||
script = ExtResource("4_um0x7")
|
||||
enemies = Array[ExtResource("7_54h7d")]([ExtResource("5_xdrk0"), ExtResource("9_q67ak")])
|
||||
quantities = Array[int]([2, 2])
|
||||
enemies = Array[ExtResource("7_54h7d")]([ExtResource("5_xdrk0"), ExtResource("9_q67ak"), ExtResource("10_jib8h")])
|
||||
quantities = Array[int]([2, 2, 1])
|
||||
spawning_duration = 10.0
|
||||
wait = 3.0
|
||||
wait_for_killed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_viqo8"]
|
||||
script = ExtResource("4_um0x7")
|
||||
enemies = Array[ExtResource("7_54h7d")]([ExtResource("5_xdrk0"), ExtResource("9_q67ak"), ExtResource("10_jib8h")])
|
||||
quantities = Array[int]([15, 3, 4])
|
||||
spawning_duration = 30.0
|
||||
wait = 10.0
|
||||
wait_for_killed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_o3j5s"]
|
||||
script = ExtResource("4_um0x7")
|
||||
enemies = Array[ExtResource("7_54h7d")]([ExtResource("5_e24vf"), ExtResource("3_xmk5u"), ExtResource("10_jib8h")])
|
||||
quantities = Array[int]([5, 5, 3])
|
||||
spawning_duration = 20.0
|
||||
wait = 5.0
|
||||
wait_for_killed = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_cygv1"]
|
||||
script = ExtResource("4_um0x7")
|
||||
enemies = Array[ExtResource("7_54h7d")]([ExtResource("5_e24vf"), ExtResource("10_jib8h"), ExtResource("3_xmk5u"), ExtResource("5_xdrk0"), ExtResource("9_q67ak")])
|
||||
quantities = Array[int]([5, 5, 10, 15, 5])
|
||||
spawning_duration = 30.0
|
||||
wait = 1.0
|
||||
wait_for_killed = true
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7w8g6"]
|
||||
size = Vector2(328, 185.333)
|
||||
|
||||
|
@ -668,8 +692,9 @@ script = ExtResource("1_3dydx")
|
|||
|
||||
[node name="Spawner" type="Node2D" parent="." node_paths=PackedStringArray("wave_label")]
|
||||
script = ExtResource("1_ifu8g")
|
||||
waves = Array[ExtResource("4_um0x7")]([SubResource("Resource_ur7l5"), SubResource("Resource_kupyp"), SubResource("Resource_o8cet"), SubResource("Resource_0cevq"), SubResource("Resource_eppj0"), SubResource("Resource_rpu1y"), SubResource("Resource_4b1vo"), SubResource("Resource_gg7kj"), SubResource("Resource_fjkob"), SubResource("Resource_5sdy5"), SubResource("Resource_61v84"), SubResource("Resource_82qld"), SubResource("Resource_2j32b")])
|
||||
waves = Array[ExtResource("4_um0x7")]([SubResource("Resource_ur7l5"), SubResource("Resource_kupyp"), SubResource("Resource_o8cet"), SubResource("Resource_0cevq"), SubResource("Resource_eppj0"), SubResource("Resource_rpu1y"), SubResource("Resource_4b1vo"), SubResource("Resource_gg7kj"), SubResource("Resource_fjkob"), SubResource("Resource_5sdy5"), SubResource("Resource_61v84"), SubResource("Resource_82qld"), SubResource("Resource_2j32b"), SubResource("Resource_viqo8"), SubResource("Resource_o3j5s"), SubResource("Resource_cygv1")])
|
||||
wave_label = NodePath("../UI/Wave Count")
|
||||
start_wave = 15
|
||||
|
||||
[node name="Timer" type="Timer" parent="Spawner"]
|
||||
wait_time = 0.1
|
||||
|
|
21
shield.gd
Normal file
21
shield.gd
Normal file
|
@ -0,0 +1,21 @@
|
|||
extends PhysicsBody2D
|
||||
|
||||
#! egregious code
|
||||
|
||||
func find_collisionshape():
|
||||
if get_parent().name == "ShieldMarker":
|
||||
return get_parent().get_parent().get_node("CollisionShape2D")
|
||||
elif get_parent().has_node("CollisionShape2D"):
|
||||
return get_parent().get_node("CollisionShape2D")
|
||||
return null
|
||||
|
||||
func _ready() -> void:
|
||||
if find_collisionshape():
|
||||
print(find_collisionshape().get_parent().name)
|
||||
find_collisionshape().set_deferred("disabled", true)
|
||||
$Collider.set_deferred("disabled", false)
|
||||
|
||||
func destroy():
|
||||
if find_collisionshape():
|
||||
find_collisionshape().set_deferred("disabled", false)
|
||||
$AnimatedSprite2D.play("die")
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=19 format=3 uid="uid://c3s8as813frjc"]
|
||||
|
||||
[ext_resource type="Script" path="res://shield.gd" id="1_ni0ln"]
|
||||
[ext_resource type="Script" path="res://shield.gd" id="1_v4v4e"]
|
||||
[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"]
|
||||
|
||||
|
@ -113,7 +113,7 @@ radius = 25.1794
|
|||
|
||||
[node name="Shield" type="StaticBody2D" groups=["destructible"]]
|
||||
scale = Vector2(3.5, 3.5)
|
||||
script = ExtResource("1_ni0ln")
|
||||
script = ExtResource("1_v4v4e")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
sprite_frames = SubResource("SpriteFrames_gcmwu")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue