Browse Source

:sparkles: bots have wiggly tails now

Felix Bytow 10 months ago
parent
commit
9169642185

+ 3 - 8
assets/scenes/bot.gd

@@ -1,14 +1,9 @@
 extends Area2D
 class_name Bot
 
-const SKINS: Array[CompressedTexture2D] = [
-	preload("res://assets/textures/bots/robits_1.png"),
-	preload("res://assets/textures/bots/robits_2.png"),
-	preload("res://assets/textures/bots/robits_3.png"),
-	preload("res://assets/textures/bots/robits_4.png"),
-]
+const SKINS: Array[String] = ["blue", "green", "red", "yellow"]
 
-@onready var sprite: Sprite2D = $Sprite2D
+@onready var sprite: AnimatedSprite2D = $AnimatedSprite2D
 @onready var base: Area2D = null
 
 @export var speed: float = 42.0
@@ -18,7 +13,7 @@ func _ready() -> void:
 	if base != null:
 		var base_center = get_base_center()
 		global_rotation = global_position.angle_to_point(base_center)
-	sprite.texture = SKINS.pick_random()
+	sprite.play(SKINS.pick_random())
 	
 func get_base_center() -> Vector2:
 	return base.get_child(0).global_position

+ 60 - 5
assets/scenes/bot.tscn

@@ -1,7 +1,61 @@
-[gd_scene load_steps=4 format=3 uid="uid://chsjfsydj2ey6"]
+[gd_scene load_steps=12 format=3 uid="uid://chsjfsydj2ey6"]
 
-[ext_resource type="Texture2D" uid="uid://b0yyuvpv4b0wc" path="res://assets/textures/bots/robits_1.png" id="1_dd3nd"]
 [ext_resource type="Script" path="res://assets/scenes/bot.gd" id="1_juoa1"]
+[ext_resource type="Texture2D" uid="uid://bx8xh4t3htyif" path="res://assets/textures/bots/blue_bot_walk_1.png" id="2_ugcr0"]
+[ext_resource type="Texture2D" uid="uid://44vpg8axkmus" path="res://assets/textures/bots/blue_bot_walk_2.png" id="3_0goqq"]
+[ext_resource type="Texture2D" uid="uid://o4c7b4w1w6so" path="res://assets/textures/bots/green_bot_walk_1.png" id="4_ued0l"]
+[ext_resource type="Texture2D" uid="uid://uuuev2sndny" path="res://assets/textures/bots/green_bot_walk_2.png" id="5_2brrq"]
+[ext_resource type="Texture2D" uid="uid://dbnw0v18whfev" path="res://assets/textures/bots/red_bot_walk_1.png" id="6_poaq6"]
+[ext_resource type="Texture2D" uid="uid://8qwxkjbbrkio" path="res://assets/textures/bots/red_bot_walk_2.png" id="7_h1w41"]
+[ext_resource type="Texture2D" uid="uid://djk2d44g5miuy" path="res://assets/textures/bots/yellow_bot_walk_1.png" id="8_po3sx"]
+[ext_resource type="Texture2D" uid="uid://duk2sr4iwwgr6" path="res://assets/textures/bots/yellow_bot_walk_2.png" id="9_7qxux"]
+
+[sub_resource type="SpriteFrames" id="SpriteFrames_b0o1s"]
+animations = [{
+"frames": [{
+"duration": 1.0,
+"texture": ExtResource("2_ugcr0")
+}, {
+"duration": 1.0,
+"texture": ExtResource("3_0goqq")
+}],
+"loop": true,
+"name": &"blue",
+"speed": 2.0
+}, {
+"frames": [{
+"duration": 1.0,
+"texture": ExtResource("4_ued0l")
+}, {
+"duration": 1.0,
+"texture": ExtResource("5_2brrq")
+}],
+"loop": true,
+"name": &"green",
+"speed": 2.0
+}, {
+"frames": [{
+"duration": 1.0,
+"texture": ExtResource("6_poaq6")
+}, {
+"duration": 1.0,
+"texture": ExtResource("7_h1w41")
+}],
+"loop": true,
+"name": &"red",
+"speed": 2.0
+}, {
+"frames": [{
+"duration": 1.0,
+"texture": ExtResource("8_po3sx")
+}, {
+"duration": 1.0,
+"texture": ExtResource("9_7qxux")
+}],
+"loop": true,
+"name": &"yellow",
+"speed": 2.0
+}]
 
 [sub_resource type="RectangleShape2D" id="RectangleShape2D_7wci8"]
 size = Vector2(46, 38)
@@ -11,10 +65,11 @@ collision_layer = 4
 collision_mask = 19
 script = ExtResource("1_juoa1")
 
-[node name="Sprite2D" type="Sprite2D" parent="."]
+[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
 rotation = 1.5708
-scale = Vector2(0.03, 0.03)
-texture = ExtResource("1_dd3nd")
+scale = Vector2(0.18, 0.18)
+sprite_frames = SubResource("SpriteFrames_b0o1s")
+animation = &"red"
 
 [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
 position = Vector2(7, 0)

BIN
assets/textures/bots/blue_bot_walk_1.png


+ 4 - 4
assets/textures/bots/robits_2.png.import → assets/textures/bots/blue_bot_walk_1.png.import

@@ -2,16 +2,16 @@
 
 importer="texture"
 type="CompressedTexture2D"
-uid="uid://bwny551hp3rrs"
-path="res://.godot/imported/robits_2.png-1d76da2b6a788a85d5a24b63d0b569d9.ctex"
+uid="uid://bx8xh4t3htyif"
+path="res://.godot/imported/blue_bot_walk_1.png-2d988a6e3952b813e543bcbb44f41bde.ctex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://assets/textures/bots/robits_2.png"
-dest_files=["res://.godot/imported/robits_2.png-1d76da2b6a788a85d5a24b63d0b569d9.ctex"]
+source_file="res://assets/textures/bots/blue_bot_walk_1.png"
+dest_files=["res://.godot/imported/blue_bot_walk_1.png-2d988a6e3952b813e543bcbb44f41bde.ctex"]
 
 [params]
 

BIN
assets/textures/bots/blue_bot_walk_2.png


+ 4 - 4
assets/textures/bots/robits_4.png.import → assets/textures/bots/blue_bot_walk_2.png.import

@@ -2,16 +2,16 @@
 
 importer="texture"
 type="CompressedTexture2D"
-uid="uid://cypc67f1ec0vp"
-path="res://.godot/imported/robits_4.png-47defe460508c5b2a4e1917f3f30da15.ctex"
+uid="uid://44vpg8axkmus"
+path="res://.godot/imported/blue_bot_walk_2.png-72ee5a83dfb0c248ff60f7f6850386e7.ctex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://assets/textures/bots/robits_4.png"
-dest_files=["res://.godot/imported/robits_4.png-47defe460508c5b2a4e1917f3f30da15.ctex"]
+source_file="res://assets/textures/bots/blue_bot_walk_2.png"
+dest_files=["res://.godot/imported/blue_bot_walk_2.png-72ee5a83dfb0c248ff60f7f6850386e7.ctex"]
 
 [params]
 

BIN
assets/textures/bots/green_bot_walk_1.png


+ 34 - 0
assets/textures/bots/green_bot_walk_1.png.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://o4c7b4w1w6so"
+path="res://.godot/imported/green_bot_walk_1.png-90109d45618cd260cfcb62030e3326fb.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/bots/green_bot_walk_1.png"
+dest_files=["res://.godot/imported/green_bot_walk_1.png-90109d45618cd260cfcb62030e3326fb.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/textures/bots/green_bot_walk_2.png


+ 34 - 0
assets/textures/bots/green_bot_walk_2.png.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://uuuev2sndny"
+path="res://.godot/imported/green_bot_walk_2.png-592c3858a385f2c7a312e5f2f4fd4c0f.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/bots/green_bot_walk_2.png"
+dest_files=["res://.godot/imported/green_bot_walk_2.png-592c3858a385f2c7a312e5f2f4fd4c0f.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/textures/bots/red_bot_walk_1.png


+ 4 - 4
assets/textures/bots/robits_1.png.import → assets/textures/bots/red_bot_walk_1.png.import

@@ -2,16 +2,16 @@
 
 importer="texture"
 type="CompressedTexture2D"
-uid="uid://b0yyuvpv4b0wc"
-path="res://.godot/imported/robits_1.png-d64f5f8eaf3591d403cd77e9fcdc12a4.ctex"
+uid="uid://dbnw0v18whfev"
+path="res://.godot/imported/red_bot_walk_1.png-62ad898c737682b45b4076b178058c38.ctex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://assets/textures/bots/robits_1.png"
-dest_files=["res://.godot/imported/robits_1.png-d64f5f8eaf3591d403cd77e9fcdc12a4.ctex"]
+source_file="res://assets/textures/bots/red_bot_walk_1.png"
+dest_files=["res://.godot/imported/red_bot_walk_1.png-62ad898c737682b45b4076b178058c38.ctex"]
 
 [params]
 

BIN
assets/textures/bots/red_bot_walk_2.png


+ 4 - 4
assets/textures/bots/robits_3.png.import → assets/textures/bots/red_bot_walk_2.png.import

@@ -2,16 +2,16 @@
 
 importer="texture"
 type="CompressedTexture2D"
-uid="uid://c08e1qa0cgmk"
-path="res://.godot/imported/robits_3.png-61b9f28e1cef7d32573290e6b05a79ab.ctex"
+uid="uid://8qwxkjbbrkio"
+path="res://.godot/imported/red_bot_walk_2.png-c57fd79e86180c7df1b2a4ae3545f229.ctex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://assets/textures/bots/robits_3.png"
-dest_files=["res://.godot/imported/robits_3.png-61b9f28e1cef7d32573290e6b05a79ab.ctex"]
+source_file="res://assets/textures/bots/red_bot_walk_2.png"
+dest_files=["res://.godot/imported/red_bot_walk_2.png-c57fd79e86180c7df1b2a4ae3545f229.ctex"]
 
 [params]
 

BIN
assets/textures/bots/robits_1.png


BIN
assets/textures/bots/robits_2.png


BIN
assets/textures/bots/robits_3.png


BIN
assets/textures/bots/robits_4.png


BIN
assets/textures/bots/yellow_bot_walk_1.png


+ 34 - 0
assets/textures/bots/yellow_bot_walk_1.png.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://djk2d44g5miuy"
+path="res://.godot/imported/yellow_bot_walk_1.png-95583e36c1066c703d81b506ca6e192c.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/bots/yellow_bot_walk_1.png"
+dest_files=["res://.godot/imported/yellow_bot_walk_1.png-95583e36c1066c703d81b506ca6e192c.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/textures/bots/yellow_bot_walk_2.png


+ 34 - 0
assets/textures/bots/yellow_bot_walk_2.png.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://duk2sr4iwwgr6"
+path="res://.godot/imported/yellow_bot_walk_2.png-7afc580f1ce44020055408b79a1ff585.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/bots/yellow_bot_walk_2.png"
+dest_files=["res://.godot/imported/yellow_bot_walk_2.png-7afc580f1ce44020055408b79a1ff585.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