diff --git a/assets/_RAW_/comet2.pxo b/assets/_RAW_/comet2.pxo new file mode 100644 index 0000000..97be40d Binary files /dev/null and b/assets/_RAW_/comet2.pxo differ diff --git a/assets/_RAW_/comet3.pxo b/assets/_RAW_/comet3.pxo new file mode 100644 index 0000000..f3ccb55 Binary files /dev/null and b/assets/_RAW_/comet3.pxo differ diff --git a/assets/_RAW_/comet4.pxo b/assets/_RAW_/comet4.pxo new file mode 100644 index 0000000..821df36 Binary files /dev/null and b/assets/_RAW_/comet4.pxo differ diff --git a/assets/img/comet2.png b/assets/img/comet2.png new file mode 100644 index 0000000..b97fc1b Binary files /dev/null and b/assets/img/comet2.png differ 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 0000000..9e04c00 Binary files /dev/null and b/assets/img/comet3.png differ diff --git a/assets/img/comet3.png.import b/assets/img/comet3.png.import new file mode 100644 index 0000000..b1b03c7 --- /dev/null +++ b/assets/img/comet3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dk2lcceleqyal" +path="res://.godot/imported/comet3.png-524767f527dbc8f654c976b7aa94ad66.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/img/comet3.png" +dest_files=["res://.godot/imported/comet3.png-524767f527dbc8f654c976b7aa94ad66.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/comet4.png b/assets/img/comet4.png new file mode 100644 index 0000000..fe47aba Binary files /dev/null and b/assets/img/comet4.png differ 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"]