From 01f939df48b800fe8c2badaf4813b7743e344e0f Mon Sep 17 00:00:00 2001 From: Melon Bread Date: Tue, 14 May 2024 20:08:32 -0400 Subject: [PATCH] Initial Invader concept added --- assets/_RAW_/invader.pxo | Bin 0 -> 736 bytes assets/img/invader.png | Bin 0 -> 342 bytes assets/img/invader.png.import | 34 ++++++++ assets/sfx/crash2.wav | Bin 0 -> 3579 bytes assets/sfx/crash2.wav.import | 24 ++++++ assets/sfx/invader.wav | Bin 0 -> 11678 bytes assets/sfx/invader.wav.import | 24 ++++++ assets/sfx/shoot2.wav | Bin 0 -> 4425 bytes assets/sfx/shoot2.wav.import | 24 ++++++ scenes/invader.tscn | 154 ++++++++++++++++++++++++++++++++++ scripts/game.gd | 2 - scripts/invader.gd | 66 +++++++++++++++ 12 files changed, 326 insertions(+), 2 deletions(-) create mode 100644 assets/_RAW_/invader.pxo create mode 100644 assets/img/invader.png create mode 100644 assets/img/invader.png.import create mode 100644 assets/sfx/crash2.wav create mode 100644 assets/sfx/crash2.wav.import create mode 100644 assets/sfx/invader.wav create mode 100644 assets/sfx/invader.wav.import create mode 100644 assets/sfx/shoot2.wav create mode 100644 assets/sfx/shoot2.wav.import create mode 100644 scenes/invader.tscn create mode 100644 scripts/invader.gd diff --git a/assets/_RAW_/invader.pxo b/assets/_RAW_/invader.pxo new file mode 100644 index 0000000000000000000000000000000000000000..22b7755bd15d74f42893c3272d568317f560da3c GIT binary patch literal 736 zcmZ>F4sc^)00IF9hLcVV3^j}l49P(5av+umVqqZG*sA|Gfq{Q2H-lKXtFl7w8fF*9 z-(er_vX-xEwNc7kw;));pTqDS+xNZ5*F#n zn}17OmXSAliq5RP?_KwJ7td06Tm1LPj2RVcvR^OS%Wro4#@a(lV(WT-X$Gz_zq9gF z=1tAb`*d1_?q0Uq9R8SrvAcAd&+FL}6Xl|B-W0oL?3FQJf;WdRFJQh~eDdl8b5Fl1 z*lS-U<~Ejagti@+HbME@ zGH$lTN8?WF9sfR2{nfmH13VY@ez9<0*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qk;C+xC7UHb_2 z z!E5^%EEYY)A4U*oo4+IpH|hrBjJh|j9Uu{5MVO%5YEaE6yW?8vyN5BY>W{B!nrciw zQBIEy&m+?<{=^gP)mNRz>jAxcSxmasI(y%zPuz1wd^p2Lb0@w_g-`HBDiZKGS8UGx pz06iLh%aCc$968Ah~mo_zM2Ko$#^sz#Fw_fdVDh)35VFv{{S_o=%4@q literal 0 HcmV?d00001 diff --git a/assets/sfx/crash2.wav.import b/assets/sfx/crash2.wav.import new file mode 100644 index 0000000..2d5210f --- /dev/null +++ b/assets/sfx/crash2.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://tvb2iqqjjsnq" +path="res://.godot/imported/crash2.wav-7a2662502c34f1d9181d94c8e86425a0.sample" + +[deps] + +source_file="res://assets/sfx/crash2.wav" +dest_files=["res://.godot/imported/crash2.wav-7a2662502c34f1d9181d94c8e86425a0.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/assets/sfx/invader.wav b/assets/sfx/invader.wav new file mode 100644 index 0000000000000000000000000000000000000000..596faaa960c7f8b093f9135ba33e8a2e82a0ee75 GIT binary patch literal 11678 zcmai4S65rjmh^p_$C-aH@3ZC)ToZ%@m|$ar$-(3dA_obC$T{bnbB-oSh~TyE-cj*d?CucM>g-R5d>IvmaX=Ww>T+#Ov#z5RnjL&L*Eg9Clto$gj= zQ+;i9mA%qlRbAK6+}hsNH#9miH9a#kGc_?f*xTuH)K^!O78Mi}6c(4+Ynxo1{Ueie ziz{nuYb%R$lf%93&brFtydRnA>FHTHh2=HP?!M8PrH!5agMf~?fU z_;245k~8wkYFm3o=hk+Q&o8eo&knbjrw7{`%Jb3^K1W4HMtzP?%PVi}7@6BRyu5q# zdLM31cb6x69F@7rUm`8RLBV04zNQsay9VdBPH%m`{`Id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T zx)}%j9>^JSgb9wYSy|0qp9dEa8rk@3KAewOA@Do-2!kH&ahs2zyT85#V)UaYk0B9b zFDPw-~WtBvWNrV@-|)K+3hb1Sc^ zLXoMg2iN}ndc3?~JwLcyPf^0N#1;nq!t?Cq$%pmG@eqvEq}T}S??D`?Zveg_h<7h} zSbnsb$EIts4u-ZQP$@O|P zO?mj7^0yG~+4lHN!k0*!HBx#$yVsq^izoDFaUdc%k);R>PXq9uMH5gwO~hZ4x!z?8B>jJYhbt>=T)f3F-BN=TX%K4~Ga_cmUy^0NlcD z5%}|6z5qD8ee~RG>KK{|Kv=kw05m_5w(xh`sGP z78&^^DZ8wpV`P5o`1-+z+u+015oWAz411A1E^e0an1sxtS{H`Bh*fQKy0bVYv7(po zo*MlvjoVCe8{AZ%k?`KiWUtenpNhi7FZ|gEBxWG3HAPv8anX?xk2lvPyKHaJ@GA@sn|$mrPE=*ZAue{WZZ+tupCx6}@Y)7jGMYID2!vGxA|)9tDm literal 0 HcmV?d00001 diff --git a/assets/sfx/invader.wav.import b/assets/sfx/invader.wav.import new file mode 100644 index 0000000..532443a --- /dev/null +++ b/assets/sfx/invader.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bb8i4s5bv1r4j" +path="res://.godot/imported/invader.wav-17eecca55097f63b87a6a4e28e915787.sample" + +[deps] + +source_file="res://assets/sfx/invader.wav" +dest_files=["res://.godot/imported/invader.wav-17eecca55097f63b87a6a4e28e915787.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/assets/sfx/shoot2.wav b/assets/sfx/shoot2.wav new file mode 100644 index 0000000000000000000000000000000000000000..395642ec949a8164d689af6cf9d7f91396f01bfe GIT binary patch literal 4425 zcmbVO*K-@k9j4#%82H2f%v+w5nUKzgkLuKUEt6M)dLa(2%|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4qiyibclG`uT}>*&d@Ca22>>7q#E>STG9-ISEe9phRNNSh#87|IvzP>K%rd55b)GZPG%A=2O#rYH3e;=V@=bdN&{^sLI-aS=6P6a2G*`` zq+t`V9XSw(%@K|*1w(KUmkV)8wm;-ZLB$&n=8h6*a=IztnVA@Ro}L1Uf|Ox$u%`^3 ze9uY2UI8DXHs@0Ue#U~nX6Q{Q{F_jc#_a&LeOF6~3c-ho<2x!0P+Cp~0^Ey2fP1O< z#Nb-LRRYTu0vcD~CB&f1Ei71QDM8T#H&;(1IZE5d4-!IBf=l>@l$KON3)U;4vc5z8^<4BbV~4>44)okRaj#6<4MvoS4RCP}{ubuFV>fzg!=| z1l)Zc#NnFU%MQE(U(ewgaB;)3J=ai>4F;C&dX@^~1F{J6K7n6ABb?xwsvx#N9@ASO z%Q;j+?B^Dap$LJ+iwk%|ieHX79wU-~P~5|HO-+PH%lv>Ipk$zeB!~<50QDRNjbj{S zbUd3X0VQyGu3_YG<38UU;ke+4+!F#e8kILXHJd)7w4cB+HHnAD4VdFvx{RiIH?G}M z0LeBqNmBUbEZcF+7S7<}Y+szO0$iYn$KzO#kb@A-mCSt!XF2#~DPhG00fZn{+!#RC z@@fIe5uk1A%07_63^asl(Wut!3@&1!hmIWRrVkSqU1(~x=lM?g+I_Q6M{URKFlg;VI5w(L}e|{gdaL3-@_}}O`fbj4E q0l&t6xo-jRw=3cBCV?6+^biS_2Y@33?!f>3|9~LFQHemWIruMLK#bS` literal 0 HcmV?d00001 diff --git a/assets/sfx/shoot2.wav.import b/assets/sfx/shoot2.wav.import new file mode 100644 index 0000000..e8c3fb7 --- /dev/null +++ b/assets/sfx/shoot2.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bg2eft275t8xi" +path="res://.godot/imported/shoot2.wav-93cee12f82dd277d215b2c88cec2c4c4.sample" + +[deps] + +source_file="res://assets/sfx/shoot2.wav" +dest_files=["res://.godot/imported/shoot2.wav-93cee12f82dd277d215b2c88cec2c4c4.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/scenes/invader.tscn b/scenes/invader.tscn new file mode 100644 index 0000000..f8095d6 --- /dev/null +++ b/scenes/invader.tscn @@ -0,0 +1,154 @@ +[gd_scene load_steps=15 format=3 uid="uid://du1namnd5kxs4"] + +[ext_resource type="Texture2D" uid="uid://7n0aykgeuaaw" path="res://assets/img/invader.png" id="1_3tryp"] +[ext_resource type="Script" path="res://scripts/invader.gd" id="1_vblvx"] +[ext_resource type="Shader" path="res://assets/shaders/PixelExplosion.gdshader" id="2_bav6d"] +[ext_resource type="AudioStream" uid="uid://bb8i4s5bv1r4j" path="res://assets/sfx/invader.wav" id="3_orakw"] +[ext_resource type="AudioStream" uid="uid://tvb2iqqjjsnq" path="res://assets/sfx/crash2.wav" id="4_5jebg"] +[ext_resource type="AudioStream" uid="uid://bg2eft275t8xi" path="res://assets/sfx/shoot2.wav" id="5_c2cqd"] + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_2etwc"] +noise_type = 0 +seed = -13 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_ca84o"] +width = 64 +height = 64 +generate_mipmaps = false +noise = SubResource("FastNoiseLite_2etwc") + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_wjoqq"] +noise_type = 0 +seed = -13 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_vfidg"] +width = 64 +height = 64 +generate_mipmaps = false +noise = SubResource("FastNoiseLite_wjoqq") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_7qjt1"] +resource_local_to_scene = true +shader = ExtResource("2_bav6d") +shader_parameter/progress = null +shader_parameter/strength = 1.0 +shader_parameter/noise_tex_normal = SubResource("NoiseTexture2D_vfidg") +shader_parameter/noise_tex = SubResource("NoiseTexture2D_ca84o") + +[sub_resource type="Animation" id="Animation_l62j8"] +resource_name = "crash" +length = 0.4 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("CrashSound:playing") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/1/type = "method" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0.4, 0.4001), +"transitions": PackedFloat32Array(1, 1), +"values": [{ +"args": [], +"method": &"queue_free" +}, { +"args": [], +"method": &"queue_free" +}] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Sprite2D:material:shader_parameter/progress") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 0.3), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [null, 0.33, 0.66, 1.0] +} + +[sub_resource type="Animation" id="Animation_cojig"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("CrashSound:playing") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Sprite2D:material:shader_parameter/progress") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [null] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_1dk2o"] +_data = { +"RESET": SubResource("Animation_cojig"), +"crash": SubResource("Animation_l62j8") +} + +[node name="Invader" type="Area2D"] +collision_layer = 3 +collision_mask = 3 +script = ExtResource("1_vblvx") + +[node name="Sprite2D" type="Sprite2D" parent="."] +material = SubResource("ShaderMaterial_7qjt1") +texture = ExtResource("1_3tryp") + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] +polygon = PackedVector2Array(12, -15, 16, -10, 24, -10, 29, -6, 32, -2, 10, 15, -3, 15, -31, -1, -31, -3, -23, -10, -15, -10, -10, -15) + +[node name="FlyingTone" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("3_orakw") +autoplay = true + +[node name="ShootSound" type="AudioStreamPlayer3D" parent="."] +stream = ExtResource("5_c2cqd") + +[node name="CrashSound" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("4_5jebg") + +[node name="ShootTimer" type="Timer" parent="."] +autostart = true + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_1dk2o") +} + +[node name="GunMarker" type="Marker2D" parent="."] +position = Vector2(2, 17) + +[node name="Projectiles" type="Node" parent="."] + +[connection signal="area_entered" from="." to="." method="_on_area_entered"] +[connection signal="body_entered" from="." to="." method="_on_body_entered"] +[connection signal="finished" from="FlyingTone" to="." method="_on_flying_tone_finished"] +[connection signal="timeout" from="ShootTimer" to="." method="_on_shoot_timer_timeout"] diff --git a/scripts/game.gd b/scripts/game.gd index 9590e80..acb3427 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -1,7 +1,5 @@ extends Node2D -# TODO: MAYBE make ufo enemey that randomly flies in from ones side to the other - const COMET_SPAWNER = preload("res://scenes/comet_spawner.tscn") @export var level : int = 1 diff --git a/scripts/invader.gd b/scripts/invader.gd new file mode 100644 index 0000000..e1472e6 --- /dev/null +++ b/scripts/invader.gd @@ -0,0 +1,66 @@ +extends Area2D + +# TODO: Make a random spawner for invaders +# TODO: Give points if shot + +signal shot + +const BULLET = preload("res://scenes/bullet.tscn") + +@export var move_speed := 100.0 +var movement_direction := Vector2.ZERO +var random_position := Vector2.ZERO +var can_shoot := false +var viewport_size : Vector2 + +func _ready() -> void: + viewport_size = get_viewport_rect().size + + # I am sorry to who has to make sense of this + random_position.x = randi_range(1, 2) + if random_position.x == 2: + random_position.x = viewport_size.x-1 + movement_direction.x = -1 + else: + movement_direction.x = 1 + random_position.y = randi_range(32, viewport_size.y + 32) + position = random_position + + +func _process(delta: float) -> void: + position += move_speed * movement_direction * delta + + if can_shoot: + # FIXME: Proper shoot angle and not able to sudoku + shoot($GunMarker.global_position, randf_range(90.0, 100.0)) + + # "Die", if off screen + if position.x > viewport_size.x or position.x < 0: + queue_free() + +func _on_flying_tone_finished() -> void: + $FlyingTone.play() + +func _on_body_entered(body: Node2D) -> void: + if body.is_in_group("ship"): + body.crash() + +func _on_area_entered(area: Area2D) -> void: + if area.is_in_group("bullet"): + shot.emit() + crash() + +func shoot(pos : Vector2, rot : float) -> void: + var bullet := BULLET.instantiate() + bullet.position = pos + bullet.rotation = rot + $Projectiles.add_child(bullet) + $ShootSound.play() + can_shoot = false + $ShootTimer.start() + +func crash() -> void: + $AnimationPlayer.play("crash") + +func _on_shoot_timer_timeout() -> void: + can_shoot = true