From 613fc89bab7e80bbe0a4c3978f03414ff6dead1c Mon Sep 17 00:00:00 2001 From: zerothelootrat Date: Mon, 3 Jun 2024 05:29:11 -0400 Subject: [PATCH] Initial repo --- .gitattributes | 2 + .gitignore | 2 + Assets/Enemy_Laser.png | Bin 0 -> 564 bytes Assets/Enemy_Laser.png.import | 34 +++++++++ Assets/Missile_Container.png | Bin 0 -> 1690 bytes Assets/Missile_Container.png.import | 34 +++++++++ Assets/Missile_art1.png | Bin 0 -> 412 bytes Assets/Missile_art1.png.import | 34 +++++++++ Assets/TIE_Fighter_Tilesheet.png | Bin 0 -> 3278 bytes Assets/TIE_Fighter_Tilesheet.png.import | 34 +++++++++ Assets/Xwing_tileset_Alphapng.png | Bin 0 -> 5344 bytes Assets/Xwing_tileset_Alphapng.png.import | 34 +++++++++ Assets/player_laser.png | Bin 0 -> 418 bytes Assets/player_laser.png.import | 34 +++++++++ Scenes/PlayerLaser.gd | 11 +++ Scenes/PlayerLaser.tscn | 30 ++++++++ Scenes/enemy_laser.tscn | 30 ++++++++ Scenes/enemy_spawner.tscn | 29 ++++++++ Scenes/enemy_xwing.tscn | 54 ++++++++++++++ Scenes/missile.tscn | 25 +++++++ Scenes/missile_pickup.tscn | 27 +++++++ Scenes/player.tscn | 75 ++++++++++++++++++++ Scenes/world.gd | 66 +++++++++++++++++ Scenes/world.tscn | 47 +++++++++++++ Scripts/enemy_laser.gd | 18 +++++ Scripts/enemy_spawner.gd | 42 +++++++++++ Scripts/enemy_xwing.gd | 86 +++++++++++++++++++++++ Scripts/missile.gd | 17 +++++ Scripts/missile_pickup.gd | 26 +++++++ Scripts/player.gd | 78 ++++++++++++++++++++ icon.svg | 1 + icon.svg.import | 37 ++++++++++ project.godot | 67 ++++++++++++++++++ 33 files changed, 974 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Assets/Enemy_Laser.png create mode 100644 Assets/Enemy_Laser.png.import create mode 100644 Assets/Missile_Container.png create mode 100644 Assets/Missile_Container.png.import create mode 100644 Assets/Missile_art1.png create mode 100644 Assets/Missile_art1.png.import create mode 100644 Assets/TIE_Fighter_Tilesheet.png create mode 100644 Assets/TIE_Fighter_Tilesheet.png.import create mode 100644 Assets/Xwing_tileset_Alphapng.png create mode 100644 Assets/Xwing_tileset_Alphapng.png.import create mode 100644 Assets/player_laser.png create mode 100644 Assets/player_laser.png.import create mode 100644 Scenes/PlayerLaser.gd create mode 100644 Scenes/PlayerLaser.tscn create mode 100644 Scenes/enemy_laser.tscn create mode 100644 Scenes/enemy_spawner.tscn create mode 100644 Scenes/enemy_xwing.tscn create mode 100644 Scenes/missile.tscn create mode 100644 Scenes/missile_pickup.tscn create mode 100644 Scenes/player.tscn create mode 100644 Scenes/world.gd create mode 100644 Scenes/world.tscn create mode 100644 Scripts/enemy_laser.gd create mode 100644 Scripts/enemy_spawner.gd create mode 100644 Scripts/enemy_xwing.gd create mode 100644 Scripts/missile.gd create mode 100644 Scripts/missile_pickup.gd create mode 100644 Scripts/player.gd create mode 100644 icon.svg create mode 100644 icon.svg.import create mode 100644 project.godot diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4709183 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Godot 4+ specific ignores +.godot/ diff --git a/Assets/Enemy_Laser.png b/Assets/Enemy_Laser.png new file mode 100644 index 0000000000000000000000000000000000000000..6943142da9e1dca4e7ffc5e1e4aad3be6f2d2ff1 GIT binary patch literal 564 zcmeAS@N?(olHy`uVBq!ia0vp^i-9)-6I(LGx_8Qa3G>U_|d^wYu*A8uaRTy$^J zM5B3b{1uh|A3e?Ae@rdxT(nV8+c}S}a~|AQ%9>Wnx-WW`yy)4ozbw05-M6EvUpTYD2op(RmZaAe;-5o);xE9n)1@)0eQ$ohULFRU*+sa{l?(+h3b1 zDedc*^T^bGt}CgT{Dbqw-~Y$&zR$O}ct2zH@|U`6=WI_|!c*-Q^hPo>@zH(X+r}t1 ze#o08@_t$7!QGibduA_dt$e@iaZR}7J>T~^Pxq)Qr=GcOY^Rrae#hpipQrUqG0Z3-4!Hx5|2Z3C0 bT;2Y`If3tyzuMEIULd}wtDnm{r-UW|wE+hX literal 0 HcmV?d00001 diff --git a/Assets/Enemy_Laser.png.import b/Assets/Enemy_Laser.png.import new file mode 100644 index 0000000..5d5ba29 --- /dev/null +++ b/Assets/Enemy_Laser.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://drigokboj4r5u" +path="res://.godot/imported/Enemy_Laser.png-8e71eb193e066963426ab7ba1d968bf4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Enemy_Laser.png" +dest_files=["res://.godot/imported/Enemy_Laser.png-8e71eb193e066963426ab7ba1d968bf4.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 diff --git a/Assets/Missile_Container.png b/Assets/Missile_Container.png new file mode 100644 index 0000000000000000000000000000000000000000..09c4f2aed56db80614d8701ae16bc119f293b866 GIT binary patch literal 1690 zcmV;L24(q)P)Px*R7pfZRCt{2ozIICR~*1UuGxC!uQxAz=2E2xX z6fuV?^dQw90v-xw|A4)e_qSknMBb>kvwb%Ad|^R ze1v>TrIP!P(&fl{z>W~{sm zvIfAbFRnU~GpJir5v_#uli@~pDOw5HFG7lr97rKLb0CGd2YB7kN{E;-EnmOE*v~(C zmJu?>zrVxs^&1_3PY1LT0{x}DPR(jB10q<5$l%q?G~?^lwiK~2bji_G252e-I;Hfx zuOr%ZS#J6@x~?)ng9wqe%PM2DGYpg!B1FhK;1cz#CMHxN@pya(U}a^6GiS~Ot|yz# zN)QH2z3iN9*^%dn@!^JxO1)9Y?8@j_WeJ;Uvz|Z z^xLm)KT#s{kSdZfWMyRq2sR!F5sOn(B}&hMhpz3^LJ6_getux*qZZZI*Kpix~1+KoO4QEtEGRUq_1y?fd#gNexm0PnsR$F^;$&x)E*g*2PZLr6-l zK9)GezuVg!wN3)?vQg();uL_>t+|;zdyW^inlpBcbeEM*r$evv?`MAkZ4oaU^^R-Z z*tX3(FaBa;GC^#+p;eb9Z44P^FRPnWD#e3`6#&X>tCZJP0eJARLMoNov;41r{KCX! zg6G?H78e&o`&=@Rx-d+q)1gi+%WJD-6YcS%xGN<{d9N;R5K&H#BU!1Z)9Jvg;!35m zulpiW{FdK~QmGWFkVvMz!){S5SeCDQe#@(b7V8iQr{PtX0U8NW1=)vLMu=h)jaGxYNM2Z+nsUTIJA&N51eHpK1YF?x1P~DZt?qX{s(e+v%%;mi$5sZtkkz2 zKjNd=IbWHJUghsxzUXvuDxz$JWHOna8Ij*i#6jgpCi~qm97+puM~Qn35#z_8E^APE zRigtmNF@~w_vPh_eam<)_WG4qRfIswpq@^r1FzP1U!m92aIzXw)(bj=qD3m{C?RzW z37T|WEEc8jvWoguiVjdXl~gp8d9{WFhUx!RZ8%vdJ?$MuwAnfdgCJ)iUI$<@85to# z7lVaDAyO$L(Pa&@GWXh3lgUU3(Fr3&F^mw!FhUeVhLA%lzSKn*OoS*#Bww4S!X{qO zsc-jdqGW#uRb*c*`L=~XI4kvoAVi>ym>{@zou#%}q+ct#i>_bA`Zn6iU@#aA27|$1 kFc=I5gTY`h7z|qSKlSt1a%bAPDF6Tf07*qoM6N<$g7S_b(EtDd literal 0 HcmV?d00001 diff --git a/Assets/Missile_Container.png.import b/Assets/Missile_Container.png.import new file mode 100644 index 0000000..99eaf38 --- /dev/null +++ b/Assets/Missile_Container.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ba5j4p3o33aye" +path="res://.godot/imported/Missile_Container.png-ea1779a71f50724f19398cf8ceec6752.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Missile_Container.png" +dest_files=["res://.godot/imported/Missile_Container.png-ea1779a71f50724f19398cf8ceec6752.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 diff --git a/Assets/Missile_art1.png b/Assets/Missile_art1.png new file mode 100644 index 0000000000000000000000000000000000000000..f228339e1b1ae4fdad4fd582ab012b2b644544ba GIT binary patch literal 412 zcmV;N0b~A&P)Px$R!KxbR7i=%l%xPP z|F}@Lxy#A=o~Et3I=uYk;QG|+H1EGL8&o)cehq&%+A+iy3|s~HU?7x`PTM9|x^ohRBJLgY7XdW%4)Uj>ffokNnxMZ4{{ z_s${7kk%L7M60V^a-YWE`DNMcL1+s@MH;aVad8WG`72E}!QgE2!ItazW#=Ms`aHA6 z!X_Xt`)EcBFEgmZN>?Ud5kqB#V@5V;un7lu$3ov?i&dy5iIocOhnpo>z}?*)%v36s zukHdka*lKP;r*#z>eX6{MqCCXOLo zwS{tufOr`p<`(rh-EF(3nD%F}4$Q^}czYiPA3l7D21pc20-CRUpU8aQBXnemhKIAz zz5xLa!~#8PbaZrjQ{zAyQcYh4E=uKSou$*A!1lL+Xh6oadV0{u$A^gVB$IETJv}^* zfjTIZF3{H224>#Ay%}h&slgA|caKg;BwWV5poit<202|Q-n3k<`9wB7t?{HbSc>R} z`QVYbxy}Y)Cd8)K%OCco>#-S(Rl^T@T7LU24E$|#N;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Omm+I8jEH?QK@pXj(dsa4h+dv`B}B;Qy%MN=CZMQ5_rNFFqnOwHm=8Jl#%Sb z+H>DR%QTiPH#Db~xKvzv*Edq7xeFbvqvdkLYjEaC6hGhPyfTUr5lt8`csy0slpSdh z@j171d&c-Di3OHR?m1#{J=h1uchigvsU^u#(en&e0P~M~Le@gPXlOxj%1Qm9fq}q9 zUMep1#=!Fp6oyPOwWdsgg@tXZxvLxNne)sNeRPrOwRt>#zu=;zq-xLuB#a|59-#5I z(_a8G0eNJiS!M2>Z;b!6Zx^-boNzQsC}{ssl2R|4?XnxH@*plsMvXuDnDwf{nh_1Xum>_ zDa;N47fPNTsWndZVaM`!QXIH1k*B7V!2B6=A{m@NX839pR zg@Nnou@~TkNuuB?f-NCwRb}GasCUv&FU?FGS;r~CE!kFSfNT=Sa$>*re{^z!ZxmH` z6;Tr_yezri{o|i(p1&KMBHKmmKsi{M-SK}EMU>|vD@jA=^q|OSo!dLy-&y~A=q#Ew zPawwR0Xn~Z@h!5_5~98?6*u0gURl0~(?YL^%h0sKdQ~PgeIc66KHCE#SaV%85RvJo zNdS)@J$lE(aqbIqth@pqG{+(op1%0o3yZTDCm4Tg@wRw LuU*ug!72X%MKsC7 literal 0 HcmV?d00001 diff --git a/Assets/Xwing_tileset_Alphapng.png.import b/Assets/Xwing_tileset_Alphapng.png.import new file mode 100644 index 0000000..7e0a7cc --- /dev/null +++ b/Assets/Xwing_tileset_Alphapng.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cetru5kowfvem" +path="res://.godot/imported/Xwing_tileset_Alphapng.png-6409f04d3b28f4a45889a5011169b7a5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Xwing_tileset_Alphapng.png" +dest_files=["res://.godot/imported/Xwing_tileset_Alphapng.png-6409f04d3b28f4a45889a5011169b7a5.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 diff --git a/Assets/player_laser.png b/Assets/player_laser.png new file mode 100644 index 0000000000000000000000000000000000000000..8a263efb0833d1b9cb55059748a099f3c1dd7aa3 GIT binary patch literal 418 zcmeAS@N?(olHy`uVBq!ia0vp^YC!DE!3HEx@rjuODaPU;cPEB*=VV?2*)g6jjv*P1 zZ>OEkWpWg7IX%tz18?ECV~z?b42BGbGk6?|B#vxkInXO{t^K7a`w@eyn-|EfyeC&> ze=Ey(JTFt+DHtvY~x7XhezS!pfZ?=Q_n&kMK>#uk2vM7-%eRKQO zu~+AA9$hGWZR4LeujJ1x>zgx`Z|;V^r^esXx0)q`n4+m~8kiXpI#a9OpOIJ$R9JJY zE@))9xh+GCo*1$3!qvQE_T zh$)6*sXeZe$$`g^m~n>_u1l9nmHTigKKjJ3?!V@>&+n;UfPv27>FVdQ&MBb@07Z+v A4*&oF literal 0 HcmV?d00001 diff --git a/Assets/player_laser.png.import b/Assets/player_laser.png.import new file mode 100644 index 0000000..c281317 --- /dev/null +++ b/Assets/player_laser.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bqcadowyi7s5v" +path="res://.godot/imported/player_laser.png-940afffeb223a28d1d940832c1c8c87a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/player_laser.png" +dest_files=["res://.godot/imported/player_laser.png-940afffeb223a28d1d940832c1c8c87a.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 diff --git a/Scenes/PlayerLaser.gd b/Scenes/PlayerLaser.gd new file mode 100644 index 0000000..fba2c00 --- /dev/null +++ b/Scenes/PlayerLaser.gd @@ -0,0 +1,11 @@ +extends Area2D + +var speed = 1000 + +func _physics_process(delta): + global_position.y += -speed * delta + +func _on_area_entered(area): + if area.is_in_group("enemies"): + area.take_damage(1) + queue_free() diff --git a/Scenes/PlayerLaser.tscn b/Scenes/PlayerLaser.tscn new file mode 100644 index 0000000..b654b70 --- /dev/null +++ b/Scenes/PlayerLaser.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=5 format=3 uid="uid://pwxmgtdyo48e"] + +[ext_resource type="Texture2D" uid="uid://bqcadowyi7s5v" path="res://Assets/player_laser.png" id="1_ncg07"] +[ext_resource type="Script" path="res://Scenes/PlayerLaser.gd" id="1_pqlo3"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_chvsx"] +radius = 3.0 +height = 64.0 + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_u0b0p"] +radius = 3.0 +height = 64.0 + +[node name="PlayerLaser" type="Area2D"] +collision_layer = 8 +collision_mask = 5 +script = ExtResource("1_pqlo3") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("1_ncg07") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(-9, -2) +shape = SubResource("CapsuleShape2D_chvsx") + +[node name="CollisionShape2D2" type="CollisionShape2D" parent="."] +position = Vector2(9, -2) +shape = SubResource("CapsuleShape2D_u0b0p") + +[connection signal="area_entered" from="." to="." method="_on_area_entered"] diff --git a/Scenes/enemy_laser.tscn b/Scenes/enemy_laser.tscn new file mode 100644 index 0000000..15b104d --- /dev/null +++ b/Scenes/enemy_laser.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=5 format=3 uid="uid://b7f571cxmtnrg"] + +[ext_resource type="Script" path="res://Scripts/enemy_laser.gd" id="1_8v0e3"] +[ext_resource type="Texture2D" uid="uid://drigokboj4r5u" path="res://Assets/Enemy_Laser.png" id="1_ejt2f"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_w6ao2"] +radius = 4.0 +height = 80.0 + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_mii0d"] +radius = 4.0 +height = 80.0 + +[node name="Area2D" type="Area2D"] +collision_layer = 16 +collision_mask = 3 +script = ExtResource("1_8v0e3") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("1_ejt2f") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(-63, 1) +shape = SubResource("CapsuleShape2D_w6ao2") + +[node name="CollisionShape2D2" type="CollisionShape2D" parent="."] +position = Vector2(61, 1) +shape = SubResource("CapsuleShape2D_mii0d") + +[connection signal="area_entered" from="." to="." method="_on_area_entered"] diff --git a/Scenes/enemy_spawner.tscn b/Scenes/enemy_spawner.tscn new file mode 100644 index 0000000..f74016a --- /dev/null +++ b/Scenes/enemy_spawner.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=2 format=3 uid="uid://cksss7drlqdum"] + +[ext_resource type="Script" path="res://Scripts/enemy_spawner.gd" id="1_urjlx"] + +[node name="EnemySpawner" type="Node2D"] +script = ExtResource("1_urjlx") + +[node name="SpawnPositions" type="Node2D" parent="."] + +[node name="SpawnPosition_01" type="Marker2D" parent="SpawnPositions"] +position = Vector2(70, 0) + +[node name="SpawnPosition_02" type="Marker2D" parent="SpawnPositions"] +position = Vector2(170, 0) + +[node name="SpawnPosition_03" type="Marker2D" parent="SpawnPositions"] +position = Vector2(270, 0) + +[node name="SpawnPosition_04" type="Marker2D" parent="SpawnPositions"] +position = Vector2(370, 0) + +[node name="SpawnPosition_05" type="Marker2D" parent="SpawnPositions"] +position = Vector2(470, 0) + +[node name="SpawnTimer" type="Timer" parent="."] +wait_time = 2.0 +autostart = true + +[connection signal="timeout" from="SpawnTimer" to="." method="_on_spawn_timer_timeout"] diff --git a/Scenes/enemy_xwing.tscn b/Scenes/enemy_xwing.tscn new file mode 100644 index 0000000..efc5709 --- /dev/null +++ b/Scenes/enemy_xwing.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=5 format=3 uid="uid://bosls7rmiowe1"] + +[ext_resource type="Texture2D" uid="uid://cetru5kowfvem" path="res://Assets/Xwing_tileset_Alphapng.png" id="1_6o3l6"] +[ext_resource type="Script" path="res://Scripts/enemy_xwing.gd" id="1_rtl0e"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_j5lso"] +atlas = ExtResource("1_6o3l6") +region = Rect2(0, 0, 174, 138) + +[sub_resource type="SpriteFrames" id="SpriteFrames_7n0lo"] +animations = [{ +"frames": [], +"loop": true, +"name": &"death", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_j5lso") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[node name="Area2D" type="Area2D" groups=["enemies"]] +collision_layer = 4 +collision_mask = 11 +script = ExtResource("1_rtl0e") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_7n0lo") +autoplay = "default" + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] +polygon = PackedVector2Array(-11, 60, -15, 57, -17, 51, -19, 42, -17, 41, -19, 32, -22, -19, -37, -19, -43, -22, -67, -22, -67, 10, -64, 14, -68, 17, -73, 16, -75, 11, -74, 8, -74, -20, -74, -47, -66, -47, -26, -69, 9, -68, 52, -46, 59, -46, 59, 13, 59, 17, 52, 18, 50, 14, 49, 9, 50, 6, 50, -4, 50, -21, 43, -23, 23, -21, 20, -17, 7, -17, 3, 32, 1, 41, 2, 43, 2, 51, -2, 59, -7, 61) + +[node name="death_timer" type="Timer" parent="."] +wait_time = 0.025 + +[node name="Marker2D" type="Marker2D" parent="."] +position = Vector2(-8, -33) + +[node name="RayCast2D" type="RayCast2D" parent="."] +position = Vector2(-8, 66) +target_position = Vector2(0, 877) +collision_mask = 11 + +[node name="Firing_timer" type="Timer" parent="."] +wait_time = 3.0 + +[connection signal="area_entered" from="." to="." method="_on_area_entered"] +[connection signal="timeout" from="death_timer" to="." method="_on_death_timer_timeout"] +[connection signal="timeout" from="Firing_timer" to="." method="_on_firing_timer_timeout"] diff --git a/Scenes/missile.tscn b/Scenes/missile.tscn new file mode 100644 index 0000000..171cdc7 --- /dev/null +++ b/Scenes/missile.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=4 format=3 uid="uid://d1k6v4vsiebym"] + +[ext_resource type="Script" path="res://Scripts/missile.gd" id="1_mehcn"] +[ext_resource type="Texture2D" uid="uid://b7o2hcw00iic0" path="res://Assets/Missile_art1.png" id="1_o2mt4"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_680qv"] +size = Vector2(10, 52) + +[node name="Missile" type="Area2D"] +collision_layer = 8 +collision_mask = 5 +script = ExtResource("1_mehcn") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("1_o2mt4") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, -17) +shape = SubResource("RectangleShape2D_680qv") + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] +polygon = PackedVector2Array(-3, -8, -88, -161, 95, -161, 3, -8) +disabled = true + +[connection signal="area_entered" from="." to="." method="_on_area_entered"] diff --git a/Scenes/missile_pickup.tscn b/Scenes/missile_pickup.tscn new file mode 100644 index 0000000..6cb2edb --- /dev/null +++ b/Scenes/missile_pickup.tscn @@ -0,0 +1,27 @@ +[gd_scene load_steps=4 format=3 uid="uid://c86ciqhnl2swc"] + +[ext_resource type="Script" path="res://Scripts/missile_pickup.gd" id="1_0iljv"] +[ext_resource type="Texture2D" uid="uid://ba5j4p3o33aye" path="res://Assets/Missile_Container.png" id="1_nti3e"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_ul5ug"] +size = Vector2(21, 27) + +[node name="missile_pickup" type="Area2D"] +collision_layer = 2 +collision_mask = 10 +script = ExtResource("1_0iljv") + +[node name="Sprite2D" type="Sprite2D" parent="."] +scale = Vector2(0.35, 0.35) +texture = ExtResource("1_nti3e") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(-0.5, -0.5) +shape = SubResource("RectangleShape2D_ul5ug") + +[node name="pickup_despawn" type="Timer" parent="."] +wait_time = 30.0 +one_shot = true + +[connection signal="area_entered" from="." to="." method="_on_area_entered"] +[connection signal="timeout" from="pickup_despawn" to="." method="_on_pickup_despawn_timeout"] diff --git a/Scenes/player.tscn b/Scenes/player.tscn new file mode 100644 index 0000000..c418501 --- /dev/null +++ b/Scenes/player.tscn @@ -0,0 +1,75 @@ +[gd_scene load_steps=9 format=3 uid="uid://bte8o05kqyhvc"] + +[ext_resource type="Script" path="res://Scripts/player.gd" id="1_k4l00"] +[ext_resource type="Texture2D" uid="uid://besujnvoryjpx" path="res://Assets/TIE_Fighter_Tilesheet.png" id="1_sd6i4"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_f6sf8"] +atlas = ExtResource("1_sd6i4") +region = Rect2(0, 0, 74, 69) + +[sub_resource type="AtlasTexture" id="AtlasTexture_sjrp2"] +atlas = ExtResource("1_sd6i4") +region = Rect2(0, 69, 74, 69) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nsx53"] +atlas = ExtResource("1_sd6i4") +region = Rect2(74, 69, 74, 69) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fjfji"] +atlas = ExtResource("1_sd6i4") +region = Rect2(148, 69, 74, 69) + +[sub_resource type="AtlasTexture" id="AtlasTexture_50ply"] +atlas = ExtResource("1_sd6i4") +region = Rect2(222, 69, 74, 69) + +[sub_resource type="SpriteFrames" id="SpriteFrames_8uxfx"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_f6sf8") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_sjrp2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nsx53") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fjfji") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_50ply") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nsx53") +}], +"loop": false, +"name": &"shoot", +"speed": 20.0 +}] + +[node name="player" type="Area2D"] +collision_layer = 2 +collision_mask = 21 +script = ExtResource("1_k4l00") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_8uxfx") +animation = &"shoot" +frame = 4 +frame_progress = 1.0 + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] +visible = false +polygon = PackedVector2Array(-34, 30, -27, 30, -27, 6, -26, 6, -25, 4, -16, 4, -16, 6, -13, 6, -12, 9, -7, 14, 2, 14, 6, 10, 12, 6, 14, 3, 19, 3, 22, 6, 24, 9, 24, 30, 31, 30, 31, -31, 24, -31, 23, -30, 23, -5, 22, -5, 21, -3, 19, -2, 13, -2, 12, -5, 9, -6, 8, -9, 5, -11, -9, -11, -13, -9, -13, -5, -16, -5, -17, -2, -24, -2, -26, -4, -28, -5, -28, -31, -34, -31, -35, -30, -35, 0, -35, 27) + +[node name="muzzle" type="Marker2D" parent="."] +position = Vector2(-2, -38) + +[connection signal="area_entered" from="." to="." method="_on_area_entered"] diff --git a/Scenes/world.gd b/Scenes/world.gd new file mode 100644 index 0000000..2d34657 --- /dev/null +++ b/Scenes/world.gd @@ -0,0 +1,66 @@ +extends Node2D + +#asset preloading +var Laser = preload("res://Scenes/PlayerLaser.tscn") +var missile = preload("res://Scenes/missile.tscn") +var missile_refil = preload("res://Scenes/missile_pickup.tscn") +var enemy_laser = preload("res://Scenes/enemy_laser.tscn") +@onready var player = $player + +#mixed variables for hud +var score = 0 +var max_health = 3 +var missiles_total = 3 +var missiles_current = 3 + + +func _on_player_spawn_laser(location): + var l = Laser.instantiate() + l.global_position = location + add_child(l) + +func _on_player_spawn_missile(location): + var m = missile.instantiate() + m.global_position = location + add_child(m) + missiles_current -= 1 + $missile_count.text = "Missiles:" + "\n" + str(missiles_current) + "/" + str(missiles_total) + + +func missile_spawn(location): + #print(str(location.global_position)) + var m = missile_refil.instantiate() + m.global_position = location + add_child(m) + +func missile_container(): + #print("signal recieved") + $player.refil_missiles() + missiles_current = 3 + $missile_count.text = "Missiles:" + "\n" + str(missiles_current) + "/" + str(missiles_total) + +func player_health(current_health): + var thing = current_health * 100 / max_health + var display = $health + display.text = "Hull Integrity" + "\n" + str(thing) + "%" + +func scored(): + score += 10 + $Score.text = "Score: " + str(score) + + + + +func fire_enemy_laser(location): + var e = enemy_laser.instantiate() + e.global_position = location + add_child(e) + + + + + + + + + diff --git a/Scenes/world.tscn b/Scenes/world.tscn new file mode 100644 index 0000000..9eb9952 --- /dev/null +++ b/Scenes/world.tscn @@ -0,0 +1,47 @@ +[gd_scene load_steps=4 format=3 uid="uid://da7fcce3oxm8u"] + +[ext_resource type="Script" path="res://Scenes/world.gd" id="1_cxia5"] +[ext_resource type="PackedScene" uid="uid://bte8o05kqyhvc" path="res://Scenes/player.tscn" id="1_hbkp4"] +[ext_resource type="PackedScene" uid="uid://cksss7drlqdum" path="res://Scenes/enemy_spawner.tscn" id="1_ts8nu"] + +[node name="World" type="Node2D"] +script = ExtResource("1_cxia5") + +[node name="EnemySpawner" parent="." instance=ExtResource("1_ts8nu")] +position = Vector2(3, -1) + +[node name="bg" type="Sprite2D" parent="."] + +[node name="player" parent="." instance=ExtResource("1_hbkp4")] +position = Vector2(251, 881) + +[node name="Score" type="Label" parent="."] +offset_left = 18.0 +offset_top = 51.0 +offset_right = 130.0 +offset_bottom = 85.0 +text = "Score: 0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="health" type="Label" parent="."] +offset_left = 400.0 +offset_top = 899.0 +offset_right = 522.0 +offset_bottom = 948.0 +text = "Hull Integrity: + 100%" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="missile_count" type="Label" parent="."] +offset_left = 13.0 +offset_top = 896.0 +offset_right = 79.0 +offset_bottom = 945.0 +text = "Missiles: +3/3" +horizontal_alignment = 1 + +[connection signal="spawn_laser" from="player" to="." method="_on_player_spawn_laser"] +[connection signal="spawn_missile" from="player" to="." method="_on_player_spawn_missile"] diff --git a/Scripts/enemy_laser.gd b/Scripts/enemy_laser.gd new file mode 100644 index 0000000..89d6e1b --- /dev/null +++ b/Scripts/enemy_laser.gd @@ -0,0 +1,18 @@ +extends Area2D + +var speed = 500 + +func _physics_process(delta): + global_position.y += speed * delta + if global_position.y > 1000: + queue_free() + + +#this is where i do stuff + + + +func _on_area_entered(area): + if area is player: + area.take_damage(1) + queue_free() diff --git a/Scripts/enemy_spawner.gd b/Scripts/enemy_spawner.gd new file mode 100644 index 0000000..db5b43e --- /dev/null +++ b/Scripts/enemy_spawner.gd @@ -0,0 +1,42 @@ +extends Node2D + +signal scored() + +var spawn_positions = null + +var enemy = preload("res://Scenes/enemy_xwing.tscn") + +func _ready(): + randomize() + spawn_positions = $SpawnPositions.get_children() + + +func spawn_enemy(): + var index = randi() % spawn_positions.size() + var enemy = enemy.instantiate() + enemy.global_position = spawn_positions[index].global_position + #connect error. unsure why. + #enemy.connect("enemy_died", get_tree().current_scene, "scored") + add_child(enemy) + +#AI Generated code, doesn't work. connect error +#func spawn_enemy(): + #var index = randi() % spawn_positions.size() + #var enemy_instance = enemy.instantiate() + #var world_node = get_node("res://Scenes/world.tscn") + #var world_script = world_node.get_script() + #enemy_instance.connect("enemy_died", world_script, 10) + #enemy_instance.global_position = spawn_positions[index].global_position + #add_child(enemy_instance) + + + +func _on_spawn_timer_timeout(): + spawn_enemy() + +func enemy_died(): + emit_signal("scored") + + +func missile_spawn(): + print("Missile") diff --git a/Scripts/enemy_xwing.gd b/Scripts/enemy_xwing.gd new file mode 100644 index 0000000..16f5f53 --- /dev/null +++ b/Scripts/enemy_xwing.gd @@ -0,0 +1,86 @@ +extends Area2D + +signal enemy_died() + +@export var speed : int = 150 + +#position where the thing shoots from +@onready var marker = $Marker2D + +#sensor location, central just for testing +@onready var ray1 = $RayCast2D + +signal missile_spawn() + +#health, duh. +var health = 3 + +#had to add for things that require sensors, going to require moving one for turrets maybe? +#for tutorial https://www.youtube.com/watch?v=V_gaCLbWqzk&ab_channel=KaanAlpar +func _ready(): + ray1.exclude_parent = true + ray1.collide_with_areas = true + + +#setting variable if it can shoot used later. +var can_shoot = true +#testing for the raycast feature. +#func _process(delta): + #print(ray1.is_colliding()) + #print(ray1.get_collider()) + +func _physics_process(delta): + #movement + global_position.y += speed * delta + #detecting player in area. + if ray1.is_colliding and ray1.get_collider() is player: + if can_shoot == true: + #shooting + fire_enemy_laser() + #starting firing timer so it cant just spam. + $Firing_timer.start() + can_shoot = false + +func take_damage(damage): + health -= damage + if health <= 0: + $death_timer.start() + #$AnimatedSprite2D.play("death") + emit_signal("enemy_died") + get_tree().current_scene.scored() + power_up_check() + #print(str(get_tree().current_scene.player.global_position)) + + + +func fire_enemy_laser(): + get_tree().current_scene.fire_enemy_laser(marker.global_position) + +func power_up_check(): + var index = randi() % 51 + + # 1 - 40 does nothing + # 40-48 spawns missiles + # 49 spawns nothing + # 50 spawns nothing + + #1-39+ 40 does nothing. + if index <= 39: + pass + # if greater than or equal to 40, and less than or equal to 48 it spawns stuff + elif index >= 40 and index <= 48: + get_tree().current_scene.missile_spawn(marker.global_position) + + #get_tree().current_scene.missile_spawn(marker.global_position) + +func _on_area_entered(area): + if area is player: + area.take_damage(1) + + +func _on_death_timer_timeout(): + queue_free() # Replace with function body. + + +func _on_firing_timer_timeout(): + can_shoot = true diff --git a/Scripts/missile.gd b/Scripts/missile.gd new file mode 100644 index 0000000..dfc037d --- /dev/null +++ b/Scripts/missile.gd @@ -0,0 +1,17 @@ +extends Area2D + +var speed = 200 +@onready var FirstStage = $CollisionShape2D +@onready var SecondStage = $CollisionPolygon2D + +func _physics_process(delta): + global_position.y += -speed * delta + + + +func _on_area_entered(area): + if area.is_in_group("enemies"): + FirstStage.disabled = true + SecondStage.disabled = false + area.take_damage(5) + queue_free() diff --git a/Scripts/missile_pickup.gd b/Scripts/missile_pickup.gd new file mode 100644 index 0000000..3e70863 --- /dev/null +++ b/Scripts/missile_pickup.gd @@ -0,0 +1,26 @@ +extends Area2D + + + +var speed = 200 + +func _ready(): + $pickup_despawn.start() + #print("ready started") + +func _physics_process(delta): + global_position.y += speed * delta + #asset clean up + if global_position.y > 980: + queue_free() + + +func _on_area_entered(area): + if area is player: + get_tree().current_scene.missile_container() + queue_free() + +#timer might be redundant, remove later +func _on_pickup_despawn_timeout(): + print("time out") + queue_free() diff --git a/Scripts/player.gd b/Scripts/player.gd new file mode 100644 index 0000000..a01cdba --- /dev/null +++ b/Scripts/player.gd @@ -0,0 +1,78 @@ +extends Area2D +class_name player + +#setting up signals +signal spawn_laser(location) +signal spawn_missile(location) + +#loading the muzzle position on load +@onready var muzzle = $muzzle + +#speed, health and direction, direction is for future animations vector sets up an Axis. +var speed = 250 +var health = 3 +var direction = "none" +var input_vector = Vector2() + +var missile_total = 3 +var missile_current = 3 +#mostly movement stuff below, + some firing commands, check happens between every frame +func _physics_process(delta): + input_vector.x = 0 + if Input.is_action_pressed("move_right"): + input_vector.x += 1 + direction = "right" + if Input.is_action_pressed("move_left"): + input_vector.x -= 1 + direction = "left" + + input_vector.y = 0 + if Input.is_action_pressed("move_forward"): + #print("fwd") + input_vector.y -= 1 + if Input.is_action_pressed("move_back"): + input_vector.y += 1 + global_position += input_vector * speed * delta + + if Input.is_action_just_pressed("shoot"): + $AnimatedSprite2D.play("shoot") + shoot_laser() + #$AnimatedSprite2D.play("default") + + #Missile launching signal + if Input.is_action_just_pressed("fire_missile"): + if missile_current > 0: + $AnimatedSprite2D.play("shoot") + shoot_missile() + missile_current -= 1 + print(str(missile_current)) + else: + print("No Missiles") + +#if entering an area with enemy, DO damage. +func take_damage(damage): + health -= damage + get_tree().current_scene.player_health(health) + if health <= 0: + get_tree().current_scene.player_health(health) + queue_free() + +#if entering an area with enemy = collision, does 1 damage +func _on_area_entered(area): + if area.is_in_group("enemies"): + area.take_damage(1) + +#sends laser shoot command to worl + muzzle position +func shoot_laser(): + emit_signal("spawn_laser",muzzle.global_position) + +#sends missile launch command to world + muzzle position +func shoot_missile(): + emit_signal("spawn_missile",muzzle.global_position) + + +func refil_missiles(): + if missile_current < missile_total: + missile_current = missile_total + else: + pass diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..3fe4f4a --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..814d9c5 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://br1cr3qk2w2wy" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..0ffac6c --- /dev/null +++ b/project.godot @@ -0,0 +1,67 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="SWGalaga" +run/main_scene="res://Scenes/world.tscn" +config/features=PackedStringArray("4.2", "Mobile") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=540 +window/size/viewport_height=960 +window/handheld/orientation=1 + +[input] + +move_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":68,"key_label":0,"unicode":100,"echo":false,"script":null) +] +} +move_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":65,"key_label":0,"unicode":97,"echo":false,"script":null) +] +} +move_forward={ +"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":87,"key_label":0,"unicode":119,"echo":false,"script":null) +] +} +move_back={ +"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":83,"key_label":0,"unicode":115,"echo":false,"script":null) +] +} +shoot={ +"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":32,"key_label":0,"unicode":32,"echo":false,"script":null) +] +} +fire_missile={ +"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,"echo":false,"script":null) +] +} + +[layer_names] + +2d_physics/layer_1="env" +2d_physics/layer_2="player" +2d_physics/layer_3="enemies" +2d_physics/layer_4="player_laser" +2d_physics/layer_5="enemy_laser" + +[rendering] + +renderer/rendering_method="mobile"