summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/snake/tongue.asepritebin0 -> 600 bytes
-rw-r--r--assets/snake/tongue.pngbin0 -> 99 bytes
-rw-r--r--assets/ui/hud/grow_progress/over.asepritebin447 -> 465 bytes
-rw-r--r--assets/ui/hud/grow_progress/over.pngbin135 -> 111 bytes
-rw-r--r--assets/ui/hud/grow_progress/progress.asepritebin450 -> 462 bytes
-rw-r--r--assets/ui/hud/grow_progress/progress.pngbin120 -> 113 bytes
-rw-r--r--assets/ui/hud/grow_progress/under.asepritebin437 -> 457 bytes
-rw-r--r--assets/ui/hud/grow_progress/under.pngbin120 -> 103 bytes
-rw-r--r--src/entities/actors/snake/scenes/Head.tscn31
-rw-r--r--src/entities/actors/snake/scripts/head.gd17
-rw-r--r--src/entities/actors/snake/sprites/tongue.pngbin0 -> 99 bytes
-rw-r--r--src/entities/actors/snake/sprites/tongue.png.import35
-rw-r--r--src/ui/UI.tscn6
-rw-r--r--src/ui/hud/progress_bars/sprites/over.pngbin135 -> 111 bytes
-rw-r--r--src/ui/hud/progress_bars/sprites/progress.pngbin120 -> 113 bytes
-rw-r--r--src/ui/hud/progress_bars/sprites/under.pngbin120 -> 103 bytes
16 files changed, 85 insertions, 4 deletions
diff --git a/assets/snake/tongue.aseprite b/assets/snake/tongue.aseprite
new file mode 100644
index 0000000..0f53ed6
--- /dev/null
+++ b/assets/snake/tongue.aseprite
Binary files differ
diff --git a/assets/snake/tongue.png b/assets/snake/tongue.png
new file mode 100644
index 0000000..be74c66
--- /dev/null
+++ b/assets/snake/tongue.png
Binary files differ
diff --git a/assets/ui/hud/grow_progress/over.aseprite b/assets/ui/hud/grow_progress/over.aseprite
index cb1f08b..d48528b 100644
--- a/assets/ui/hud/grow_progress/over.aseprite
+++ b/assets/ui/hud/grow_progress/over.aseprite
Binary files differ
diff --git a/assets/ui/hud/grow_progress/over.png b/assets/ui/hud/grow_progress/over.png
index 82714cf..c5e102d 100644
--- a/assets/ui/hud/grow_progress/over.png
+++ b/assets/ui/hud/grow_progress/over.png
Binary files differ
diff --git a/assets/ui/hud/grow_progress/progress.aseprite b/assets/ui/hud/grow_progress/progress.aseprite
index 16a5fc2..a7d963a 100644
--- a/assets/ui/hud/grow_progress/progress.aseprite
+++ b/assets/ui/hud/grow_progress/progress.aseprite
Binary files differ
diff --git a/assets/ui/hud/grow_progress/progress.png b/assets/ui/hud/grow_progress/progress.png
index 0d9ba96..1ddfd77 100644
--- a/assets/ui/hud/grow_progress/progress.png
+++ b/assets/ui/hud/grow_progress/progress.png
Binary files differ
diff --git a/assets/ui/hud/grow_progress/under.aseprite b/assets/ui/hud/grow_progress/under.aseprite
index 2f78684..5763fd4 100644
--- a/assets/ui/hud/grow_progress/under.aseprite
+++ b/assets/ui/hud/grow_progress/under.aseprite
Binary files differ
diff --git a/assets/ui/hud/grow_progress/under.png b/assets/ui/hud/grow_progress/under.png
index 8c8b269..f31d502 100644
--- a/assets/ui/hud/grow_progress/under.png
+++ b/assets/ui/hud/grow_progress/under.png
Binary files differ
diff --git a/src/entities/actors/snake/scenes/Head.tscn b/src/entities/actors/snake/scenes/Head.tscn
index 336265b..a08197b 100644
--- a/src/entities/actors/snake/scenes/Head.tscn
+++ b/src/entities/actors/snake/scenes/Head.tscn
@@ -1,7 +1,32 @@
-[gd_scene load_steps=4 format=2]
+[gd_scene load_steps=10 format=2]
[ext_resource path="res://entities/actors/snake/sprites/head.png" type="Texture" id=1]
[ext_resource path="res://entities/actors/snake/scripts/head.gd" type="Script" id=2]
+[ext_resource path="res://entities/actors/snake/sprites/tongue.png" type="Texture" id=3]
+
+[sub_resource type="AtlasTexture" id=2]
+atlas = ExtResource( 3 )
+region = Rect2( 0, 0, 4, 4 )
+
+[sub_resource type="AtlasTexture" id=3]
+atlas = ExtResource( 3 )
+region = Rect2( 4, 0, 4, 4 )
+
+[sub_resource type="AtlasTexture" id=4]
+atlas = ExtResource( 3 )
+region = Rect2( 8, 0, 4, 4 )
+
+[sub_resource type="AtlasTexture" id=5]
+atlas = ExtResource( 3 )
+region = Rect2( 12, 0, 4, 4 )
+
+[sub_resource type="SpriteFrames" id=6]
+animations = [ {
+"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
+"loop": false,
+"name": "default",
+"speed": 15.0
+} ]
[sub_resource type="CircleShape2D" id=1]
radius = 2.0
@@ -10,6 +35,10 @@ radius = 2.0
collision_mask = 262
script = ExtResource( 2 )
+[node name="Tongue" type="AnimatedSprite" parent="."]
+position = Vector2( 0, -5 )
+frames = SubResource( 6 )
+
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
diff --git a/src/entities/actors/snake/scripts/head.gd b/src/entities/actors/snake/scripts/head.gd
index 117f461..1e17b18 100644
--- a/src/entities/actors/snake/scripts/head.gd
+++ b/src/entities/actors/snake/scripts/head.gd
@@ -5,12 +5,19 @@ enum {
RIGHT=1
}
+onready var tongue_sprite: AnimatedSprite = $Tongue
+
var _initial_speed: float = Global.SNAKE_SPEED
var velocity: Vector2 = Vector2.ZERO
var _direction: Vector2 = Vector2.UP
var _time_elapsed: float = 0.0
+func _ready() -> void:
+ Event.connect("food_eaten", self, "_on_food_eaten")
+ tongue_sprite.visible = false
+
+
func _physics_process(delta: float) -> void:
if Input.is_action_pressed("move_left"):
_rotate_to(LEFT)
@@ -36,3 +43,13 @@ func _handle_time_elapsed(delta: float) -> void:
Event.emit_signal("snake_path_new_point", global_position)
_time_elapsed = 0.0
_time_elapsed += delta
+
+
+func _on_food_eaten(properties: Dictionary) -> void:
+ print("tongue food eaten")
+ if not tongue_sprite.visible:
+ tongue_sprite.visible = true
+ tongue_sprite.play()
+ yield(tongue_sprite, "animation_finished")
+ tongue_sprite.stop()
+ tongue_sprite.frame = 0
diff --git a/src/entities/actors/snake/sprites/tongue.png b/src/entities/actors/snake/sprites/tongue.png
new file mode 100644
index 0000000..be74c66
--- /dev/null
+++ b/src/entities/actors/snake/sprites/tongue.png
Binary files differ
diff --git a/src/entities/actors/snake/sprites/tongue.png.import b/src/entities/actors/snake/sprites/tongue.png.import
new file mode 100644
index 0000000..6899fff
--- /dev/null
+++ b/src/entities/actors/snake/sprites/tongue.png.import
@@ -0,0 +1,35 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/tongue.png-0200be53e2fea7c532d2e177715af415.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://entities/actors/snake/sprites/tongue.png"
+dest_files=[ "res://.import/tongue.png-0200be53e2fea7c532d2e177715af415.stex" ]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=false
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=false
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+process/normal_map_invert_y=false
+stream=false
+size_limit=0
+detect_3d=false
+svg/scale=1.0
diff --git a/src/ui/UI.tscn b/src/ui/UI.tscn
index 14701f0..980faf4 100644
--- a/src/ui/UI.tscn
+++ b/src/ui/UI.tscn
@@ -28,11 +28,11 @@ margin_bottom = 8.0
[node name="HBoxProgressBars" type="HBoxContainer" parent="Root/StatsHUD/VBox"]
margin_top = 12.0
margin_right = 120.0
-margin_bottom = 20.0
+margin_bottom = 16.0
[node name="GrowthProgress" parent="Root/StatsHUD/VBox/HBoxProgressBars" instance=ExtResource( 4 )]
-margin_right = 40.0
-margin_bottom = 8.0
+margin_right = 20.0
+margin_bottom = 4.0
[node name="MarginContainer" type="MarginContainer" parent="Root"]
anchor_top = 1.0
diff --git a/src/ui/hud/progress_bars/sprites/over.png b/src/ui/hud/progress_bars/sprites/over.png
index 82714cf..c5e102d 100644
--- a/src/ui/hud/progress_bars/sprites/over.png
+++ b/src/ui/hud/progress_bars/sprites/over.png
Binary files differ
diff --git a/src/ui/hud/progress_bars/sprites/progress.png b/src/ui/hud/progress_bars/sprites/progress.png
index 0d9ba96..1ddfd77 100644
--- a/src/ui/hud/progress_bars/sprites/progress.png
+++ b/src/ui/hud/progress_bars/sprites/progress.png
Binary files differ
diff --git a/src/ui/hud/progress_bars/sprites/under.png b/src/ui/hud/progress_bars/sprites/under.png
index 8c8b269..f31d502 100644
--- a/src/ui/hud/progress_bars/sprites/under.png
+++ b/src/ui/hud/progress_bars/sprites/under.png
Binary files differ