From 5ad6c6d3b19a49013551df8a68f99ae1040ff61f Mon Sep 17 00:00:00 2001 From: Melon Bread Date: Thu, 16 May 2024 14:37:49 -0400 Subject: [PATCH] Comet now has one of four different sprites --- assets/_RAW_/comet2.pxo | Bin 0 -> 1092 bytes assets/_RAW_/comet3.pxo | Bin 0 -> 1085 bytes assets/_RAW_/comet4.pxo | Bin 0 -> 907 bytes assets/img/comet2.png | Bin 0 -> 563 bytes assets/img/comet2.png.import | 34 ++++++++++++++++++++++++++++++++++ assets/img/comet3.png | Bin 0 -> 588 bytes assets/img/comet3.png.import | 34 ++++++++++++++++++++++++++++++++++ assets/img/comet4.png | Bin 0 -> 506 bytes assets/img/comet4.png.import | 34 ++++++++++++++++++++++++++++++++++ scenes/comet.tscn | 7 ++++--- scripts/comet.gd | 11 ++++++++++- 11 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 assets/_RAW_/comet2.pxo create mode 100644 assets/_RAW_/comet3.pxo create mode 100644 assets/_RAW_/comet4.pxo create mode 100644 assets/img/comet2.png create mode 100644 assets/img/comet2.png.import create mode 100644 assets/img/comet3.png create mode 100644 assets/img/comet3.png.import create mode 100644 assets/img/comet4.png create mode 100644 assets/img/comet4.png.import diff --git a/assets/_RAW_/comet2.pxo b/assets/_RAW_/comet2.pxo new file mode 100644 index 0000000000000000000000000000000000000000..97be40d8c1175de5a6c113cc01c5dacc3e4be5eb GIT binary patch literal 1092 zcmZ>F4sc^)00IF9hE69225ul{B9NO5#J7PMD8!(#RsU}S13#|-!?S7b`V-VW+5dyV zbTKKVCXR_^H>%(N)0b8(63*QI>p|4f_4y}^es`*#o$+Vi_Y7t$26F~$2LJF9r=`A| zK5Hzo-!q5vsYdL2&D7ic%#+?}ly0a|d0_eB#VMhia}E?(^ffzuF8Mxfv6)u%vEx@F zf4Fvkc@uN<)*YjxKEhWW<{nz!-`Db`OiEZzb92b0=|&!M)v8F#!s)MmB&4kPIEh6`NQKqYF{|VN(5&&3N9@@932gu9St0v3W`gvOyqB9{3AO5h*Rdb9r9{tT&vP7{_RkbmRXU| ze>Zmd-woVG|Ne*Tv3~!0ZTHJrvpG-M^%`_W8%<0<`}IcYnX@*3YOlmzH*z??O=eba zMT_{6_0MW&R9^CAo3L+BpTsiS4^mNP?lt!%`DU)cpzW}1BYf~px=U?5AQk7bM)9T9B_Yp z%~s!6jn|I3RxSCx2m9BB{|=Q-{kr(Z&;MmFs*`ITXdCH#oBeTL_Pnj%_uXGUFDBsE z+u7f`EH?G~B|qlaGx>~0cwF+LJ5?-akN%4d@bT_dV1+v9EE9tg3k%x=eue}eu2oRL z;y6R#13QDz4DSaT2Au!e9%wRoE|?PR^q9H%@E&o4Tl`bLHf`bwjNrVc!Qpgm`qG~X zci0%&6Ysrl^yfA)PU_{^Szsig0kfi)jo}8SpP^y!|9|m{1^EWdm$q05JrHnEuwnGr z#3JA#tiaUD!m0hp#h|TemsMwX?THq<%#Zrl%+KUpt(>Oyk%@o9B)N4@9-UgX_gTt{ zy*EVK-;_VTnz_c`MNd?IchR2w8CQ1K`04%JUb59+@Ivnf-qO$+{lDu{|6Tl^9s0;; zZO-4r47~@dze|5k{#|>{c#n$TkJ|e5n1v7KJz&}^D^|C|ujA~2w`Mh_?~3Q|m%6%l z!7hHU^|zjh2Fk1aT)I$p2{`mR8ILkD82ktOM1(=R`2Z7FX~Bb?!n?Ez5>>YFaOnF_ jV3A-GZc<=8z+iDC=0zr>1iKZRm7>C3i3CP>VEF+6893+y literal 0 HcmV?d00001 diff --git a/assets/_RAW_/comet3.pxo b/assets/_RAW_/comet3.pxo new file mode 100644 index 0000000000000000000000000000000000000000..f3ccb55ee3caa6af3e848e1e21cb04af88fd138a GIT binary patch literal 1085 zcmZ>F4sc^)00IF9hT~2Q41z#T1dtmG#Hx%83|c^1W2^q(1O|Rv0S30~9{Lm1J=y<* z!E`Yxr6!JvWjBi6|JyIEI7uLL`>zL4N7v`y+Vrhc^~j7rc1x4Etr%<>tQf-MOAamd zHxf}@;eN(KlsjtIn&?{*?pz$D8JWz-{29fX{I4%Nk;c-h?Ah1y{8hfBdu`aRp4%cx zA9}hBtLM#Q&?qP^{dvw~!MVW2IsWk+a_p>;94s;s9NUf5H<_?+-zD2npuH+#F=NZ` zmBmw38}{VB5-8p6z{KuizpcP^aKq5ioYee^mFI9hYmg zGI(BBy5I9JZ=mv(3rBo{L+sQGIK%hHCUmd?dVU-Py34=*dGv?vbFcsmFKfw z_kMc2rNJ^F)T3fWN@~@!mCJXP@t>WzrS;)~1X|Z@Znko1uTv;1U|4c2uTDhi2pHEE@@Jqap*k% z8U-V@j|DFG6>ATh^k(|JC=E!w(zL=a=whI=v*W2hted)=7ke>6&7I4{;DlkWkTb;G z8NmY2`vyXaByLgOW{yxQ%n$;z@XTpu!QA^ z1f$^*i6tFD?5B>*n^;+KP$u}@zSV6Ljt70ba6R4jYUR^ChStG8Jes%V6n56U5J_r3 z{CfUttIx(u6f#TN-)cW$-h2G0C?ZnglDR{}GyV zN?Offp1DWW%DFcJ(w1Dm2mTugxPuqpFW*p-+Um zs}t8;j~A!1Sc1TTbexfuks;zgB8a#I7-me8nVHo4;fqsSu!5|AP9C#6u;2gy4tB}r literal 0 HcmV?d00001 diff --git a/assets/_RAW_/comet4.pxo b/assets/_RAW_/comet4.pxo new file mode 100644 index 0000000000000000000000000000000000000000..821df36827b2867cbc54724af945ddde3199e350 GIT binary patch literal 907 zcmZ>F4sc^)00IF9hE69S4dgTcsZbzJ17Zyj-m3pMfq{Q3KZDwJ5B&-1p6vg@V7i!; zQWM9-vK!U!|LIFBP7=u6{_8>1(e?Q!jDB~ju8qjETj9rT&0xu3&9ML1B4NGSNeej~ zZ67@i(aCuE=~mD-SxuE!7cQ}#_Ggr1nZM3w;#qc9mL>&(d8>DCm-!lb)5vbwg+seuE1JZ4W$yURUTnkEUhQ*x;alCl>s`lU!`P!&9Gu6ZB&5RX>6lfrp=qMxZeF2; zW)Th*lSdqaf(lM8EgberJpvwAZ8_}E=D)tNm-p@7+e>xxlK)q0yy;u_Z1+*ks^a7{ z&S|^Oc&i^yJA32xnqTYIDcyhNrTC`j?wZI6$C%D#crR+77Rc}`V%77)*0nM#iYFeq z6xiU_Xy3!V!#Bi9z-G5?oB8d@{MVUNALz&53Q5d-5bpEJz{~Q-cRdD{zdOWwr%t}$ z@@k%t$n~G;=PV{Rab6Mn!>#LS8qt>@qMPybn3WLY<{QPYOg`FX!Q!8p;RXZ4e_T*o zq2ci*Dds$dg9#t}nAt;@1vn;BSo%ex8p(4;z{p!WIAcbA4lva#V1TY5s9Q z!ov1| zpCQ4AYZVl*IL;9Gz|J5vBW!_~PLtP#*8llE{O4tJ7!sTpooixacAX~Wx7C|>`7PJp z$x{5%Qre8w{N`EgvzJ2+eTvUe3HJpm7ldc9@Ol=oxK|vLSlsiOG3JPpH?RHyCKZE* z0GU#Qkf6FSjh164o~?a!M3METRlv7JubxZIc`Y5YCg*_<7uc3g#;*(v0f?aE6kxF6 XT;#q$!go^4p$x4FdP3apz-$Nrfk=8Q literal 0 HcmV?d00001 diff --git a/assets/img/comet2.png b/assets/img/comet2.png new file mode 100644 index 0000000000000000000000000000000000000000..b97fc1bdfabb1e6f140c29880e4d83cd11a8dd4a GIT binary patch literal 563 zcmV-30?hr1P)Px$?MXyIRCt{2TT7P2AP9uKx&M_jn>NouMB}funA)XdCr}iii6L?hjt}npzSTj@ zto@DvCdxbBb>TxuQwfNTpFvIwW)YeYFycn5NE>166aq%0me3a46RGb=fQAw&wSK6% zehLXOT05B922Ug)hDJutr)$1B>!CS&e~^rogRG033aiaSDnNoi2*)uYmmIj#upQt+ z0Rfr{ToFK&lHiU2B8NrL!XE;5S^2F%P{Bh0>Kveii^x~xC6XH8Df&eJ6CuA{!0kjx z!X*LO#gMmdz|8DU0m-ug?F4E!(0o)C;3*ZVkMesX_44c7ZV3lIuub)G0gz{&al)^-R5 z^Z<^4w{;Bac|c1ofLaVSZ<9laevCItfU5ySsl!%XV6^BtzMxt8*+LstLWPY23r~Rux797YK-{Sb{^vLcIiBIN?>T%pO zVi5`2ea&x%N;2&+{F^C|%mV^yj2a!S)kH}9e*xH9TyW4NiYEX7002ovPDHLkV1f^u B@B{z= literal 0 HcmV?d00001 diff --git a/assets/img/comet2.png.import b/assets/img/comet2.png.import new file mode 100644 index 0000000..c7af00e --- /dev/null +++ b/assets/img/comet2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b8swdgkngg7a3" +path="res://.godot/imported/comet2.png-5c168a7393426970d7715a9f51cb4f6a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/img/comet2.png" +dest_files=["res://.godot/imported/comet2.png-5c168a7393426970d7715a9f51cb4f6a.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/img/comet3.png b/assets/img/comet3.png new file mode 100644 index 0000000000000000000000000000000000000000..9e04c00a87672bb26f169441b0b1045bf5db0698 GIT binary patch literal 588 zcmV-S0<-;zP)Px%21!IgRCt{2ThS7OAPfU<|NqPEW$X|OZE2xW&C_l}Y+?xLFoq40QcC%Aj4?|3 z5*@6Kk{AaP5ljUbB@AIyge3xSh;oS3{f>wr7C?FxrDIr{2do1mWTixVkcfabrjVXV zj*48TssIrAJCKDi>VjrN&AE0JMruB=2D^|CVXRhA0L}T?3RDg!#Wd#CJAf02u{_}P z!=~gz;AO$#jeH2a`cD}Uf6y<<4pS9#F1Xwa|ER>b={u*))==KO-M4SRok!t)^~9u&H&r#lw${J aPJ98il}L3r_w%&?0000Px$v`IukRCt{2o7)nDAPhtor~m)U^vMpz0099Z>v`*V%Pt8;0fzTopY}0 z{MHAB+zEIDH6}D0Fj{nNOUChNudg;BCA>D^5rnY~F`(7unbex_8Fk}bPzl*hd`-OB z4A>#%?{cIL>@2<})}#TgH(ZU<-?b=gx0+9((Q(NDE8?~M3A8A_q{(Sd+?kvkgh9rFl!23B2ASr>=oB%*#08lY8V!0m>Cq|@$mU+Jl2YBzj zXn^H105YG%Sjr$IyHL`4CIE^hGS*E($j1v&2ofJ21^U;qFB07*qoM6N<$g55;cFaQ7m literal 0 HcmV?d00001 diff --git a/assets/img/comet4.png.import b/assets/img/comet4.png.import new file mode 100644 index 0000000..477ba9b --- /dev/null +++ b/assets/img/comet4.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://by4nqr5c4t6i" +path="res://.godot/imported/comet4.png-02d5c45d52e8bd739a883c09308a279d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/img/comet4.png" +dest_files=["res://.godot/imported/comet4.png-02d5c45d52e8bd739a883c09308a279d.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/comet.tscn b/scenes/comet.tscn index bc1fe08..33f8c9a 100644 --- a/scenes/comet.tscn +++ b/scenes/comet.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=13 format=3 uid="uid://bsonrs8vhtly8"] -[ext_resource type="Texture2D" uid="uid://54mfrkbp1kcg" path="res://assets/img/comet.png" id="1_6q67h"] [ext_resource type="Script" path="res://scripts/comet.gd" id="1_33qxe"] [ext_resource type="Shader" path="res://assets/shaders/PixelExplosion.gdshader" id="2_2l5nu"] +[ext_resource type="Texture2D" uid="uid://b8swdgkngg7a3" path="res://assets/img/comet2.png" id="3_7qdji"] [ext_resource type="AudioStream" uid="uid://eb71wdy8dy4x" path="res://assets/sfx/explosion.wav" id="3_awuk4"] [sub_resource type="FastNoiseLite" id="FastNoiseLite_wa814"] @@ -114,10 +114,11 @@ script = ExtResource("1_33qxe") [node name="Sprite2D" type="Sprite2D" parent="."] material = SubResource("ShaderMaterial_6s6e6") -texture = ExtResource("1_6q67h") +texture = ExtResource("3_7qdji") [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] -polygon = PackedVector2Array(19, -27, 22, -25, 25, -24, 27, -21, 31, -17, 32, -3, 32, 27, 27, 30, -8, 29, -17, 28, -25, 26, -32, 22, -32, 18, -23, 8, -20, 7, -21, 2, -29, -17, -29, -26, -27, -29, -25, -32, -14, -32, 0, -30) +position = Vector2(0, -1.5) +polygon = PackedVector2Array(17, -29.5, 30, -19.5, 31, 2.5, 32, 28.5, 18, 33.5, -25, 32.5, -29, 25.5, -31, -18.5, -22, -26.5) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] libraries = { diff --git a/scripts/comet.gd b/scripts/comet.gd index cf88d13..3a90185 100644 --- a/scripts/comet.gd +++ b/scripts/comet.gd @@ -1,6 +1,5 @@ extends Area2D -# TODO: Have like 1 in 4 different sprites (and maybe shapes) the comet can be signal exploded (new_size: SIZE, current_position: Vector2) @@ -14,6 +13,13 @@ var size_data = { SIZE.LARGE : {"Scale": 2.5, "Speed-Multi": 0.5} } +var texture_options = [ + "res://assets/img/comet.png", + "res://assets/img/comet2.png", + "res://assets/img/comet3.png", + "res://assets/img/comet4.png" +] + var movement_speed : int var movement_speed_min : int = 50 var movement_speed_max : int = 250 @@ -23,6 +29,9 @@ var rotation_speed : int var rotaion_direction : int func _ready() -> void: + $Sprite2D.texture = load(texture_options.pick_random()) + + movement_speed = randi_range(movement_speed_min, movement_speed_max) movement_speed *= size_data[current_size]["Speed-Multi"]