Comet now has one of four different sprites

This commit is contained in:
Rain Clark 2024-05-16 14:37:49 -04:00
parent 4f025868e6
commit 5ad6c6d3b1
11 changed files with 116 additions and 4 deletions

BIN
assets/_RAW_/comet2.pxo Normal file

Binary file not shown.

BIN
assets/_RAW_/comet3.pxo Normal file

Binary file not shown.

BIN
assets/_RAW_/comet4.pxo Normal file

Binary file not shown.

BIN
assets/img/comet2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

View File

@ -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

BIN
assets/img/comet3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

View File

@ -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

BIN
assets/img/comet4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

View File

@ -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

View File

@ -1,8 +1,8 @@
[gd_scene load_steps=13 format=3 uid="uid://bsonrs8vhtly8"] [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="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="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"] [ext_resource type="AudioStream" uid="uid://eb71wdy8dy4x" path="res://assets/sfx/explosion.wav" id="3_awuk4"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_wa814"] [sub_resource type="FastNoiseLite" id="FastNoiseLite_wa814"]
@ -114,10 +114,11 @@ script = ExtResource("1_33qxe")
[node name="Sprite2D" type="Sprite2D" parent="."] [node name="Sprite2D" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_6s6e6") material = SubResource("ShaderMaterial_6s6e6")
texture = ExtResource("1_6q67h") texture = ExtResource("3_7qdji")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] [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="."] [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = { libraries = {

View File

@ -1,6 +1,5 @@
extends Area2D 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) signal exploded (new_size: SIZE, current_position: Vector2)
@ -14,6 +13,13 @@ var size_data = {
SIZE.LARGE : {"Scale": 2.5, "Speed-Multi": 0.5} 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 : int
var movement_speed_min : int = 50 var movement_speed_min : int = 50
var movement_speed_max : int = 250 var movement_speed_max : int = 250
@ -23,6 +29,9 @@ var rotation_speed : int
var rotaion_direction : int var rotaion_direction : int
func _ready() -> void: func _ready() -> void:
$Sprite2D.texture = load(texture_options.pick_random())
movement_speed = randi_range(movement_speed_min, movement_speed_max) movement_speed = randi_range(movement_speed_min, movement_speed_max)
movement_speed *= size_data[current_size]["Speed-Multi"] movement_speed *= size_data[current_size]["Speed-Multi"]