Skip to content

Commit 5add708

Browse files
committed
add waddles in silly positions on the map
- upside down waddles on the bottom left of the map (inspired by the old labmap) - a second waddles will peek, look around, and go back to hiding behind the wall
1 parent 8673a08 commit 5add708

5 files changed

Lines changed: 158 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[gd_resource type="Curve2D" format=3 uid="uid://bbnm20mcstj5f"]
2+
3+
[resource]
4+
_data = {
5+
"points": PackedVector2Array(0, 0, 0, 0, -197.596, 266.499, 0, 0, 0, 0, -174.305, 180.413)
6+
}
7+
point_count = 2

frontend/labmap2/scenes/floor_map.tscn

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=20 format=4 uid="uid://dgy3vf0xjb874"]
1+
[gd_scene load_steps=23 format=4 uid="uid://dgy3vf0xjb874"]
22

33
[ext_resource type="Script" path="res://scripts/floor_map.gd" id="1_423c3"]
44
[ext_resource type="Texture2D" uid="uid://cqt0vr61f2bxi" path="res://art/floor_sheet.png" id="1_eg3gw"]
@@ -14,6 +14,9 @@
1414
[ext_resource type="Texture2D" uid="uid://cuaj5txrl38kg" path="res://art/background2.png" id="11_e0kwo"]
1515
[ext_resource type="Script" path="res://scenes/clock.gd" id="12_yemy0"]
1616
[ext_resource type="Script" path="res://scenes/http_get_lab_hours.gd" id="13_1la2h"]
17+
[ext_resource type="Texture2D" uid="uid://cm2iovdubwp6l" path="res://waddles.svg" id="13_io7p8"]
18+
[ext_resource type="Script" path="res://scripts/waddles_peek.gd" id="14_aes6m"]
19+
[ext_resource type="Curve2D" uid="uid://bbnm20mcstj5f" path="res://paths/waddles_peek.tres" id="15_ukbc7"]
1720

1821
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_dqocb"]
1922
resource_name = "Floor Tiles"
@@ -246,6 +249,38 @@ position = Vector2(-31, -63)
246249
texture = ExtResource("11_e0kwo")
247250
metadata/_edit_lock_ = true
248251

252+
[node name="Waddles" type="Sprite2D" parent="."]
253+
z_index = -1
254+
position = Vector2(-483, 216)
255+
rotation = -2.04029
256+
scale = Vector2(1.3, 1.3)
257+
texture = ExtResource("13_io7p8")
258+
metadata/_edit_lock_ = true
259+
260+
[node name="WaddlesPeek" type="Path2D" parent="."]
261+
z_index = 1
262+
position = Vector2(396, -281)
263+
rotation = 0.280998
264+
scale = Vector2(0.8, 0.8)
265+
curve = ExtResource("15_ukbc7")
266+
267+
[node name="PathFollow2D" type="PathFollow2D" parent="WaddlesPeek"]
268+
position = Vector2(-197.596, 266.499)
269+
rotation = -1.30657
270+
loop = false
271+
script = ExtResource("14_aes6m")
272+
273+
[node name="Waddles" type="Sprite2D" parent="WaddlesPeek/PathFollow2D"]
274+
z_index = -1
275+
position = Vector2(173.872, 43.5333)
276+
rotation = 1.50526
277+
texture = ExtResource("13_io7p8")
278+
metadata/_edit_lock_ = true
279+
280+
[node name="PeekInterval" type="Timer" parent="WaddlesPeek/PathFollow2D"]
281+
wait_time = 1800.0
282+
autostart = true
283+
249284
[node name="Clock" type="RichTextLabel" parent="."]
250285
offset_left = 209.0
251286
offset_top = 239.0
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# waddles will peek, look around, and go back to hiding behind the wall
2+
3+
extends PathFollow2D
4+
5+
@export var move_speed := 50.0
6+
@export var flip_speed := 0.3
7+
@export var pause_duration := 2.0
8+
@export var peek_interval := 1800.0 # 30 min
9+
10+
enum State {
11+
HIDDEN,
12+
MOVING_UP,
13+
LOOKING,
14+
MOVING_DOWN
15+
}
16+
var state = State.HIDDEN # start out as hidden
17+
18+
@onready var timer = $PeekInterval
19+
@onready var waddles = $Waddles
20+
21+
func _ready():
22+
# looping is controlled by this script, dont auto loop
23+
self.loop = false
24+
25+
# start as hidden
26+
waddles.visible = false
27+
28+
# configure the timer
29+
timer.wait_time = peek_interval
30+
timer.one_shot = false
31+
timer.autostart = true
32+
timer.start()
33+
timer.timeout.connect(self._on_timer_timeout)
34+
35+
# on timeout, start the peeking sequence if waddles is hiding
36+
func _on_timer_timeout():
37+
if state == State.HIDDEN:
38+
state = State.MOVING_UP
39+
print("waddles: haii")
40+
41+
# move up or down a bit on each frame if the sequence is in progress
42+
# speed is configurable with move_speed
43+
func _process(delta):
44+
# length of the path wadddles follows to peek
45+
var path_len = get_parent().curve.get_baked_length()
46+
47+
match state:
48+
State.MOVING_UP:
49+
waddles.visible = true
50+
progress += move_speed * delta # move up a bit
51+
52+
# when waddles reaches the end of the path and is currently peeking
53+
# above the wall, look around
54+
if progress >= path_len:
55+
progress = path_len
56+
state = State.LOOKING
57+
look_around()
58+
State.MOVING_DOWN:
59+
progress -= move_speed * delta # move down a bit
60+
61+
# when waddles goes back to the start of the path, hide again
62+
if progress <= 0:
63+
progress = 0
64+
state = State.HIDDEN
65+
waddles.visible = false
66+
print("waddles: byee")
67+
68+
func look_around():
69+
print("waddles: 👀")
70+
var tween = create_tween()
71+
72+
# pause, look left, pause, look right, pause, move down
73+
tween.tween_callback(func(): pass).set_delay(pause_duration)
74+
tween.tween_property(waddles, "scale:x", - waddles.scale.x, flip_speed) # flip
75+
tween.tween_callback(func(): pass).set_delay(pause_duration)
76+
tween.tween_property(waddles, "scale:x", + waddles.scale.x, flip_speed) # flip back
77+
tween.tween_callback(func(): state = State.MOVING_DOWN).set_delay(pause_duration)

frontend/labmap2/waddles.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://cm2iovdubwp6l"
6+
path="res://.godot/imported/waddles.svg-b347c044d03fd2754b54507c8c7b1823.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://waddles.svg"
14+
dest_files=["res://.godot/imported/waddles.svg-b347c044d03fd2754b54507c8c7b1823.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1
35+
svg/scale=1.0
36+
editor/scale_with_editor_scale=false
37+
editor/convert_colors_with_editor_theme=false

0 commit comments

Comments
 (0)