added more waves

This commit is contained in:
ultrablob 2024-04-25 20:56:12 -04:00
parent 0c0cc1d5f1
commit 1a2b9290c5
16 changed files with 201 additions and 36 deletions

View file

@ -17,6 +17,7 @@ func _physics_process(delta):
#print(collision.get_collider().name) #print(collision.get_collider().name)
hit(collision.get_collider()) hit(collision.get_collider())
velocity = velocity.bounce(clamp_to_1bit(collision.get_normal())) velocity = velocity.bounce(clamp_to_1bit(collision.get_normal()))
$CollisionFX.play()
move_and_slide() move_and_slide()

View file

@ -1,13 +1,9 @@
extends Node2D extends Node2D
func _ready():
process_mode = Node.PROCESS_MODE_ALWAYS
func _input(event): func _input(event):
if event.is_action_pressed("restart") and $GameOver/Leaderboard/HTTPRequest.get_http_client_status() == HTTPClient.STATUS_DISCONNECTED: if event.is_action_pressed("restart") and $"../GameOver/Leaderboard/HTTPRequest".get_http_client_status() == HTTPClient.STATUS_DISCONNECTED:
get_tree().paused = false get_tree().paused = false
get_tree().reload_current_scene() get_tree().reload_current_scene()
if event.is_action_pressed("quit") and $GameOver/Leaderboard/HTTPRequest.get_http_client_status() == HTTPClient.STATUS_DISCONNECTED: if event.is_action_pressed("quit") and $"../GameOver/Leaderboard/HTTPRequest".get_http_client_status() == HTTPClient.STATUS_DISCONNECTED:
get_tree().paused = false get_tree().paused = false
get_tree().change_scene_to_file("res://main_menu.tscn") get_tree().change_scene_to_file("res://main_menu.tscn")

View file

@ -22,7 +22,9 @@ func spawn_loop():
spawn_enemies(wave.quantities[i], wave.spawning_duration, wave.enemies[i]) spawn_enemies(wave.quantities[i], wave.spawning_duration, wave.enemies[i])
if wave.wait_for_killed: if wave.wait_for_killed:
await all_enemies_perished await all_enemies_perished
await get_tree().create_timer(wave.spawning_duration + wave.wait).timeout else:
await get_tree().create_timer(wave.spawning_duration).timeout
await get_tree().create_timer(wave.wait).timeout
func spawn_enemies(count: int, duration: float, enemy: WaveEnemy): func spawn_enemies(count: int, duration: float, enemy: WaveEnemy):
var delay = duration / count var delay = duration / count

View file

@ -1,13 +1,15 @@
[gd_scene load_steps=6 format=3 uid="uid://c54oi61t8bvtu"] [gd_scene load_steps=6 format=3 uid="uid://c54oi61t8bvtu"]
[ext_resource type="Script" path="res://Entagon.gd" id="1_726g8"] [ext_resource type="Script" path="res://Entagon.gd" id="1_726g8"]
[ext_resource type="PhysicsMaterial" uid="uid://c5tm7od8mwjjb" path="res://elastic.tres" id="1_pvpk5"]
[ext_resource type="SpriteFrames" uid="uid://cffqo7q1ofatc" path="res://entagon.gif" id="3_116st"] [ext_resource type="SpriteFrames" uid="uid://cffqo7q1ofatc" path="res://entagon.gif" id="3_116st"]
[ext_resource type="Texture2D" uid="uid://djfjdlri5xdkn" path="res://dotted line.png" id="4_vixiu"] [ext_resource type="Texture2D" uid="uid://djfjdlri5xdkn" path="res://dotted line.png" id="4_vixiu"]
[ext_resource type="Script" path="res://TrajectoryDisplay.gd" id="5_w6b4q"] [ext_resource type="Script" path="res://TrajectoryDisplay.gd" id="5_w6b4q"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_odemo"]
bounce = 1.0
[node name="Entagon" type="RigidBody2D" groups=["enemy"]] [node name="Entagon" type="RigidBody2D" groups=["enemy"]]
physics_material_override = ExtResource("1_pvpk5") physics_material_override = SubResource("PhysicsMaterial_odemo")
gravity_scale = 1.66533e-16 gravity_scale = 1.66533e-16
max_contacts_reported = 2 max_contacts_reported = 2
contact_monitor = true contact_monitor = true

11
entagon_enemy.tres Normal file
View file

@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="WaveEnemy" load_steps=4 format=3 uid="uid://824inmsxuois"]
[ext_resource type="PackedScene" uid="uid://c54oi61t8bvtu" path="res://entagon.tscn" id="1_mfudl"]
[ext_resource type="SpriteFrames" uid="uid://cfma586cg6lul" path="res://entagon_ortal.tres" id="2_2xm8e"]
[ext_resource type="Script" path="res://wave_enemy.gd" id="3_t4kaf"]
[resource]
script = ExtResource("3_t4kaf")
enemy = ExtResource("1_mfudl")
portal_texture = ExtResource("2_2xm8e")
check_distance = 100

74
entagon_ortal.tres Normal file
View file

@ -0,0 +1,74 @@
[gd_resource type="SpriteFrames" load_steps=11 format=3 uid="uid://cfma586cg6lul"]
[ext_resource type="Texture2D" uid="uid://byn1o4jm6dn4y" path="res://entagon portal.png" id="1_l0wmj"]
[sub_resource type="AtlasTexture" id="AtlasTexture_a62ih"]
atlas = ExtResource("1_l0wmj")
region = Rect2(0, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_nahmg"]
atlas = ExtResource("1_l0wmj")
region = Rect2(64, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_1r0bi"]
atlas = ExtResource("1_l0wmj")
region = Rect2(128, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_1tpqj"]
atlas = ExtResource("1_l0wmj")
region = Rect2(192, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_r05kc"]
atlas = ExtResource("1_l0wmj")
region = Rect2(256, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_ns23r"]
atlas = ExtResource("1_l0wmj")
region = Rect2(320, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_4nxec"]
atlas = ExtResource("1_l0wmj")
region = Rect2(384, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_2bl8r"]
atlas = ExtResource("1_l0wmj")
region = Rect2(448, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_17iyw"]
atlas = ExtResource("1_l0wmj")
region = Rect2(512, 0, 64, 64)
[resource]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_a62ih")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nahmg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1r0bi")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1tpqj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_r05kc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ns23r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4nxec")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2bl8r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_17iyw")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=7 format=3 uid="uid://cepurdbgvu4b6"] [gd_scene load_steps=8 format=3 uid="uid://cepurdbgvu4b6"]
[ext_resource type="Texture2D" uid="uid://pa732bpnx3p6" path="res://explosion.png" id="1_jiu1j"] [ext_resource type="Texture2D" uid="uid://pa732bpnx3p6" path="res://explosion.png" id="1_jiu1j"]
[ext_resource type="AudioStream" uid="uid://vfiu54q6ce2s" path="res://explosionCrunch_004.ogg" id="2_pkpxk"]
[sub_resource type="AtlasTexture" id="AtlasTexture_8ecv2"] [sub_resource type="AtlasTexture" id="AtlasTexture_8ecv2"]
atlas = ExtResource("1_jiu1j") atlas = ExtResource("1_jiu1j")
@ -44,4 +45,10 @@ scale = Vector2(3, 3)
sprite_frames = SubResource("SpriteFrames_70iie") sprite_frames = SubResource("SpriteFrames_70iie")
autoplay = "default" autoplay = "default"
[connection signal="animation_looped" from="." to="." method="queue_free"] [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("2_pkpxk")
volume_db = -2.0
autoplay = true
[connection signal="animation_looped" from="." to="." method="hide"]
[connection signal="finished" from="AudioStreamPlayer2D" to="." method="queue_free"]

BIN
explosionCrunch_004.ogg Normal file

Binary file not shown.

View file

@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://vfiu54q6ce2s"
path="res://.godot/imported/explosionCrunch_004.ogg-e64f3680929153c9524405e98321b964.oggvorbisstr"
[deps]
source_file="res://explosionCrunch_004.ogg"
dest_files=["res://.godot/imported/explosionCrunch_004.ogg-e64f3680929153c9524405e98321b964.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

BIN
impactMetal_002.ogg Normal file

Binary file not shown.

View file

@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://dn65uapn0wsok"
path="res://.godot/imported/impactMetal_002.ogg-bed8fa488e9e2ea953422c64cb765a15.oggvorbisstr"
[deps]
source_file="res://impactMetal_002.ogg"
dest_files=["res://.godot/imported/impactMetal_002.ogg-bed8fa488e9e2ea953422c64cb765a15.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View file

@ -4,7 +4,7 @@
[ext_resource type="Script" path="res://laser_enemy.gd" id="2_lyi2i"] [ext_resource type="Script" path="res://laser_enemy.gd" id="2_lyi2i"]
[ext_resource type="Script" path="res://Laser.gd" id="3_hosl5"] [ext_resource type="Script" path="res://Laser.gd" id="3_hosl5"]
[ext_resource type="SpriteFrames" uid="uid://d320lntdiw2kj" path="res://ircle.gif" id="3_ys12y"] [ext_resource type="SpriteFrames" uid="uid://d320lntdiw2kj" path="res://ircle.gif" id="3_ys12y"]
[ext_resource type="AudioStream" uid="uid://fyudre3xo1j2" path="res://laser4.ogg" id="5_1qck7"] [ext_resource type="AudioStream" uid="uid://4ou7posn1vbd" path="res://laserSmall_004.ogg" id="5_tkxjf"]
[sub_resource type="CircleShape2D" id="CircleShape2D_yns8h"] [sub_resource type="CircleShape2D" id="CircleShape2D_yns8h"]
radius = 128.0 radius = 128.0
@ -49,7 +49,7 @@ autostart = true
shape = SubResource("CircleShape2D_yns8h") shape = SubResource("CircleShape2D_yns8h")
[node name="LaserFX" type="AudioStreamPlayer2D" parent="."] [node name="LaserFX" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_1qck7") stream = ExtResource("5_tkxjf")
[connection signal="timeout" from="Line2D/VisibleTimer" to="Line2D" method="hide_self"] [connection signal="timeout" from="Line2D/VisibleTimer" to="Line2D" method="hide_self"]
[connection signal="timeout" from="Timer" to="." method="fire_laser"] [connection signal="timeout" from="Timer" to="." method="fire_laser"]

BIN
laserSmall_004.ogg Normal file

Binary file not shown.

19
laserSmall_004.ogg.import Normal file
View file

@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://4ou7posn1vbd"
path="res://.godot/imported/laserSmall_004.ogg-9928730d0a3000f88292dbca29edba43.oggvorbisstr"
[deps]
source_file="res://laserSmall_004.ogg"
dest_files=["res://.godot/imported/laserSmall_004.ogg-9928730d0a3000f88292dbca29edba43.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View file

@ -49,7 +49,7 @@ func fire_laser():
tween.tween_callback(set_laser_texture.bind(idle_texture)) tween.tween_callback(set_laser_texture.bind(idle_texture))
func play_with_delay(): func play_with_delay():
await get_tree().create_timer(0.75).timeout await get_tree().create_timer(0.9).timeout
$LaserFX.play() $LaserFX.play()
func set_laser_texture(texture): func set_laser_texture(texture):
@ -62,6 +62,8 @@ func can_shoot(yn):
can_damage = yn can_damage = yn
func destroy(): func destroy():
if is_queued_for_deletion():
return
var explosion = load("res://explosion.tscn").instantiate() var explosion = load("res://explosion.tscn").instantiate()
$"/root/Node2D".add_child(explosion) $"/root/Node2D".add_child(explosion)
explosion.global_position = global_position explosion.global_position = global_position

File diff suppressed because one or more lines are too long