moar waves

This commit is contained in:
ultrablob 2024-05-07 21:32:08 -04:00
parent 8344c034e4
commit 10655aed3a
18 changed files with 229 additions and 13 deletions

3
Gun.gd
View file

@ -1,10 +1,11 @@
extends Marker2D
@export var bullet: PackedScene
@export var bullet_speed = 500
func shoot():
#print("Shooting")
var node = bullet.instantiate()
node.global_position = global_position
node.linear_velocity = Vector2(500, 0).rotated(global_rotation)
node.linear_velocity = Vector2(bullet_speed, 0).rotated(global_rotation)
$/root/Node2D.add_child(node)

7
Turret.gd Normal file
View file

@ -0,0 +1,7 @@
extends Node2D
var target: Node2D
func _process(delta):
if target:
look_at(target.global_position)

View file

@ -5,6 +5,8 @@ var bounces = 0
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"):

View file

@ -9,4 +9,4 @@ script = ExtResource("3_t4kaf")
enemy = ExtResource("1_mfudl")
boss = false
portal_texture = ExtResource("2_2xm8e")
check_distance = 400
check_distance = 250

View file

@ -70,5 +70,5 @@ animations = [{
}],
"loop": true,
"name": &"default",
"speed": 5.0
"speed": 8.0
}]

BIN
eptagon-turret.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

34
eptagon-turret.png.import Normal file
View file

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

11
eptagon.gd Normal file
View file

@ -0,0 +1,11 @@
extends StaticBody2D
# Called when the node enters the scene tree for the first time.
func _ready():
$Turret.target = $"../Player"
#print($Turret.target)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

BIN
eptagon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

34
eptagon.png.import Normal file
View file

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

68
eptagon.tscn Normal file
View file

@ -0,0 +1,68 @@
[gd_scene load_steps=12 format=3 uid="uid://bda763f0fxh5k"]
[ext_resource type="Script" path="res://eptagon.gd" id="1_d0pdl"]
[ext_resource type="Texture2D" uid="uid://d4f0f3ggnd3rl" path="res://eptagon.png" id="1_kwkxh"]
[ext_resource type="Script" path="res://Turret.gd" id="2_6tkha"]
[ext_resource type="Script" path="res://Gun.gd" id="2_sea5o"]
[ext_resource type="Texture2D" uid="uid://d1wxsdwad10p6" path="res://eptagon-turret.png" id="3_jhgw8"]
[ext_resource type="PackedScene" uid="uid://c6ybtahxwpukd" path="res://bullet.tscn" id="4_cyd7j"]
[sub_resource type="AtlasTexture" id="AtlasTexture_1fcnk"]
atlas = ExtResource("3_jhgw8")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_hhi7e"]
atlas = ExtResource("3_jhgw8")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_lo0cp"]
atlas = ExtResource("3_jhgw8")
region = Rect2(0, 32, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_1fj5a"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_1fcnk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hhi7e")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lo0cp")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_03ifk"]
radius = 36.0139
[node name="Eptagon" type="StaticBody2D" groups=["destructible"]]
script = ExtResource("1_d0pdl")
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(3, 3)
texture = ExtResource("1_kwkxh")
[node name="Turret" type="Node2D" parent="."]
script = ExtResource("2_6tkha")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Turret"]
position = Vector2(14, 0)
rotation = -1.5708
scale = Vector2(3, 3)
sprite_frames = SubResource("SpriteFrames_1fj5a")
autoplay = "default"
[node name="Gun" type="Marker2D" parent="Turret"]
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")
[connection signal="animation_looped" from="Turret/AnimatedSprite2D" to="Turret/Gun" method="shoot"]

12
eptagon_enemy.tres Normal file
View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="WaveEnemy" load_steps=4 format=3 uid="uid://dd8me0deake37"]
[ext_resource type="PackedScene" uid="uid://bda763f0fxh5k" path="res://eptagon.tscn" id="1_a0tpa"]
[ext_resource type="Script" path="res://wave_enemy.gd" id="1_ueugq"]
[ext_resource type="SpriteFrames" uid="uid://cfma586cg6lul" path="res://entagon_ortal.tres" id="2_7hbx6"]
[resource]
script = ExtResource("1_ueugq")
enemy = ExtResource("1_a0tpa")
boss = false
portal_texture = ExtResource("2_7hbx6")
check_distance = 150

View file

@ -2,12 +2,13 @@ extends Node2D
var config = ConfigFile.new()
# Called when the node enters the scene tree for the first time.
func _ready():
func _init():
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)
add_child(player)
func _ready():
$Music.volume_db = linear_to_db(config.get_value("config", "music_volume", 1))

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=111 format=3 uid="uid://bmd4m7lqj4v0x"]
[gd_scene load_steps=115 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"]
@ -12,6 +12,7 @@
[ext_resource type="Texture2D" uid="uid://yvrhlh04k8w1" path="res://background space.png" id="6_yg4g1"]
[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://dd8me0deake37" path="res://eptagon_enemy.tres" id="9_q67ak"]
[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"]
@ -108,6 +109,30 @@ spawning_duration = 5.0
wait = 15.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])
spawning_duration = 20.0
wait = 2.0
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
wait = 5.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")])
quantities = Array[int]([2, 2])
spawning_duration = 10.0
wait = 3.0
wait_for_killed = true
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7w8g6"]
size = Vector2(328, 185.333)
@ -641,7 +666,7 @@ 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")])
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_82qld"), SubResource("Resource_61v84"), SubResource("Resource_2j32b")])
wave_label = NodePath("../UI/Wave Count")
[node name="Timer" type="Timer" parent="Spawner"]
@ -708,6 +733,7 @@ rotation = -1.5708
shape = SubResource("WorldBoundaryShape2D_rmvst")
[node name="UI" type="Control" parent="."]
z_index = 10
layout_mode = 3
anchors_preset = 0
offset_right = 1920.0
@ -730,14 +756,15 @@ anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 44.0
offset_top = -137.0
offset_top = -175.0
offset_right = 279.0
offset_bottom = -38.0
grow_vertical = 0
theme_override_constants/line_spacing = 0
theme_override_fonts/font = ExtResource("11_s4q6p")
theme_override_font_sizes/font_size = 50
text = "2 Quares
1 Exagon"
text = "Gun"
vertical_alignment = 2
[node name="Stopwatch" type="Label" parent="UI"]
layout_mode = 1

View file

@ -8,7 +8,7 @@
[ext_resource type="Script" path="res://EmojiValidator.gd" id="6_ojb71"]
[ext_resource type="Texture2D" uid="uid://1mfe7gltx0lk" path="res://blue_sliderDown.png" id="6_tt6es"]
[ext_resource type="Script" path="res://VolumeSlider.gd" id="7_qc1t8"]
[ext_resource type="AudioStream" uid="uid://b8soxqg0jquqg" path="res://Flow State 2.ogg" id="8_uvg4p"]
[ext_resource type="AudioStream" uid="uid://dumcnppcm3cex" path="res://title screen.ogg" id="9_rc4r7"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4ojsq"]
bg_color = Color(0.6, 0.6, 0.6, 0)
@ -298,7 +298,7 @@ bbcode_enabled = true
text = "[center][wave]LOADING..."
[node name="Music" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("8_uvg4p")
stream = ExtResource("9_rc4r7")
autoplay = true
bus = &"Music"

View file

@ -63,7 +63,7 @@ func aquire_exagon():
update_display()
func update_display():
$"../UI/Quare Count".text = "%d Quares\n" % [(max_quares - num_quares)]
$"/root/Node2D/UI/Quare Count".text = "%d Quares\n" % [(max_quares - num_quares)]
var num_quares = 0
var max_quares = 3

BIN
title screen.ogg Normal file

Binary file not shown.

19
title screen.ogg.import Normal file
View file

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