Init commit

This commit is contained in:
Benjamin Morgan 2025-10-19 20:04:59 -06:00
commit a4452b69c4
59 changed files with 1259 additions and 0 deletions

55
Scenes/explosion.tscn Normal file
View file

@ -0,0 +1,55 @@
[gd_scene load_steps=8 format=3 uid="uid://g6cu38jl3h32"]
[ext_resource type="Script" uid="uid://lawrmxvtimw1" path="res://Scripts/explosion.gd" id="1_a801j"]
[ext_resource type="Texture2D" uid="uid://cv84w0y2jg3i3" path="res://Sprites/i_are_spaceship.png" id="2_4okmj"]
[sub_resource type="AtlasTexture" id="AtlasTexture_vxas0"]
atlas = ExtResource("2_4okmj")
region = Rect2(48, 31, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_j4sxf"]
atlas = ExtResource("2_4okmj")
region = Rect2(32, 31, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_m5xho"]
atlas = ExtResource("2_4okmj")
region = Rect2(16, 31, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_kmxf7"]
atlas = ExtResource("2_4okmj")
region = Rect2(0, 31, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_l04k4"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_vxas0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j4sxf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_m5xho")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kmxf7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j4sxf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vxas0")
}],
"loop": true,
"name": &"default",
"speed": 12.0
}]
[node name="Node2D" type="Node2D"]
[node name="Area2D" type="Area2D" parent="."]
script = ExtResource("1_a801j")
[node name="Explosion" type="AnimatedSprite2D" parent="Area2D"]
sprite_frames = SubResource("SpriteFrames_l04k4")
autoplay = "default"

67
Scenes/game_over.tscn Normal file
View file

@ -0,0 +1,67 @@
[gd_scene load_steps=4 format=3 uid="uid://dliccivjx8fcm"]
[ext_resource type="Script" uid="uid://cf1vwutwpi4rf" path="res://Scripts/game_over.gd" id="1_ojehl"]
[sub_resource type="LabelSettings" id="LabelSettings_i2yjh"]
font_size = 72
[sub_resource type="LabelSettings" id="LabelSettings_ojehl"]
font_size = 32
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_ojehl")
[node name="Container" type="Control" parent="."]
layout_mode = 1
anchors_preset = 13
anchor_left = 0.5
anchor_right = 0.5
anchor_bottom = 1.0
offset_top = -100.0
offset_bottom = -100.0
grow_horizontal = 2
grow_vertical = 2
[node name="Title" type="Label" parent="Container"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -195.0
offset_right = 195.0
offset_bottom = 99.0
grow_horizontal = 2
text = "Game Over"
label_settings = SubResource("LabelSettings_i2yjh")
[node name="Score" type="Label" parent="Container"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -60.5
offset_top = 85.0
offset_right = 60.5
offset_bottom = 130.0
grow_horizontal = 2
text = "Score: 0"
label_settings = SubResource("LabelSettings_ojehl")
[node name="New Game" type="Button" parent="Container"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -46.5
offset_top = 150.0
offset_right = 46.5
offset_bottom = 181.0
grow_horizontal = 2
text = "New Game"

21
Scenes/laser.tscn Normal file
View file

@ -0,0 +1,21 @@
[gd_scene load_steps=4 format=3 uid="uid://nf2xr7ufei5a"]
[ext_resource type="Script" uid="uid://csldj2x1axso1" path="res://Scripts/laser.gd" id="1_6vqwg"]
[ext_resource type="Texture2D" uid="uid://cv84w0y2jg3i3" path="res://Sprites/i_are_spaceship.png" id="1_fn5yt"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_6vqwg"]
radius = 3.0
height = 10.0
[node name="Laser" type="Area2D"]
script = ExtResource("1_6vqwg")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(-1, 1)
scale = Vector2(2, 2)
texture = ExtResource("1_fn5yt")
region_enabled = true
region_rect = Rect2(34, 17, 3, 7)
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CapsuleShape2D_6vqwg")

9
Scenes/life.tscn Normal file
View file

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://j2mr8pluyo37"]
[ext_resource type="Texture2D" uid="uid://cvfsmhdbgh8vh" path="res://Sprites/idle_spaceship.png" id="1_bkce2"]
[node name="Life" type="TextureRect"]
offset_right = 15.0
offset_bottom = 24.0
texture = ExtResource("1_bkce2")
stretch_mode = 4

64
Scenes/main_menu.tscn Normal file
View file

@ -0,0 +1,64 @@
[gd_scene load_steps=3 format=3 uid="uid://c4ld5hjy5d8g3"]
[ext_resource type="Script" uid="uid://dxbdiq4y3mqtd" path="res://Scripts/main_menu.gd" id="1_28flt"]
[sub_resource type="LabelSettings" id="LabelSettings_i2yjh"]
font_size = 72
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_28flt")
[node name="Container" type="Control" parent="."]
layout_mode = 1
anchors_preset = 13
anchor_left = 0.5
anchor_right = 0.5
anchor_bottom = 1.0
offset_top = -100.0
offset_bottom = -100.0
grow_horizontal = 2
grow_vertical = 2
[node name="Title" type="Label" parent="Container"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -195.0
offset_right = 195.0
offset_bottom = 99.0
grow_horizontal = 2
text = "Asteroids"
label_settings = SubResource("LabelSettings_i2yjh")
horizontal_alignment = 1
[node name="New Game" type="Button" parent="Container"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -46.5
offset_top = 111.0
offset_right = 46.5
offset_bottom = 142.0
grow_horizontal = 2
text = "New Game"
[node name="Quit" type="Button" parent="Container"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -46.5
offset_top = 150.0
offset_right = 46.5
offset_bottom = 181.0
grow_horizontal = 2
text = "Quit"

97
Scenes/ship.tscn Normal file
View file

@ -0,0 +1,97 @@
[gd_scene load_steps=16 format=3 uid="uid://dwvw8qerrwuu0"]
[ext_resource type="Script" uid="uid://p443pc5fxxg0" path="res://Scripts/ship.gd" id="1_6ejuo"]
[ext_resource type="PackedScene" uid="uid://nf2xr7ufei5a" path="res://Scenes/laser.tscn" id="2_8aq7e"]
[ext_resource type="Texture2D" uid="uid://bdwr76wwjquob" path="res://Sprites/fly_spaceship.png" id="3_cmder"]
[ext_resource type="AudioStream" uid="uid://docuh1bqh2uba" path="res://Sounds/laser4.wav" id="3_fwcnm"]
[ext_resource type="Texture2D" uid="uid://cvfsmhdbgh8vh" path="res://Sprites/idle_spaceship.png" id="4_fwcnm"]
[ext_resource type="Texture2D" uid="uid://dtcdw0p6jcw00" path="res://Sprites/left_spaceship.png" id="5_cmder"]
[ext_resource type="Texture2D" uid="uid://c0quqc1en7jo" path="res://Sprites/right_spaceship.png" id="6_fwcnm"]
[sub_resource type="AtlasTexture" id="AtlasTexture_272bh"]
atlas = ExtResource("3_cmder")
region = Rect2(15, 0, 15, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_5vw27"]
atlas = ExtResource("3_cmder")
region = Rect2(0, 0, 15, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_kxdp2"]
atlas = ExtResource("5_cmder")
region = Rect2(15, 0, 15, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_v2j2m"]
atlas = ExtResource("5_cmder")
region = Rect2(0, 0, 15, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_1m05r"]
atlas = ExtResource("6_fwcnm")
region = Rect2(15, 0, 15, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_ssryt"]
atlas = ExtResource("6_fwcnm")
region = Rect2(0, 0, 15, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_1bvp3"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_272bh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5vw27")
}],
"loop": true,
"name": &"fly",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("4_fwcnm")
}],
"loop": true,
"name": &"idle",
"speed": 0.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_kxdp2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_v2j2m")
}],
"loop": true,
"name": &"left",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_1m05r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ssryt")
}],
"loop": true,
"name": &"right",
"speed": 5.0
}]
[sub_resource type="ConvexPolygonShape2D" id="ConvexPolygonShape2D_kek77"]
points = PackedVector2Array(-6, 0, -7, 7, 8, 7, 7, 0, 0, -8)
[node name="Ship" type="CharacterBody2D"]
script = ExtResource("1_6ejuo")
Laser = ExtResource("2_8aq7e")
pew = ExtResource("3_fwcnm")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_1bvp3")
animation = &"right"
autoplay = "idle"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -4)
shape = SubResource("ConvexPolygonShape2D_kek77")
[node name="Muzzle" type="Marker2D" parent="."]
position = Vector2(0, -15)