devlog #9 夜市ねこ / night market cat: month 7, 412 wishlists, lanterns that flicker
開発ログ。今月はランタンの光。This month: lantern light, a tiny shader, and cats that walk through things
Contents
開発ログ #9。今月はランタンの光を作りました。
devlog #9! this month I made the lanterns (=^・ω・^=)
数字 / numbers
- wishlists: 412 (+38 this month)
- savings: about 14 months left, if I eat a lot of rice
- bugs fixed: 23. bugs created: 26 😿
ランタン / lanterns
(GIF: the night market street, paper lanterns swaying a little, the light on the stalls slowly breathing, the cat shopkeeper blinks)
I wanted the lanterns to feel alive, but not like a disco. In Godot 4 each lantern has a PointLight2D with a soft texture, and the lantern sprite has a tiny canvas_item shader so the paper flickers a bit. It is very small:
shader_type canvas_item;
uniform float speed = 3.0;
uniform float strength = 0.08;
uniform float offset = 0.0;
void fragment() {
vec4 c = texture(TEXTURE, UV);
float flicker = 1.0
+ sin(TIME * speed + offset) * strength
+ sin(TIME * speed * 2.3 + offset * 1.7) * strength * 0.5;
COLOR = vec4(c.rgb * flicker, c.a);
}
Two sine waves at an odd ratio looks less like a robot than one wave. The offset is important: if every lantern flickers together it looks like the power is failing ahaha. I turn on "Local To Scene" on the ShaderMaterial so every lantern gets its own copy, then in _ready() I do material.set_shader_parameter("offset", randf() * 10.0).
今月のバグ / bug of the month
Cats walking straight through the lanterns. NavigationAgent2D avoidance was on, but the lanterns were not obstacles, so the cats did not care at all. I added a NavigationObstacle2D to the lantern scene. Fixed. muzukashii...
(GIF: before the fix, a cat walks through a lantern, the lantern swings, the cat does not even look)
来月はたこ焼き屋台のミニゲーム。Next month: the takoyaki stall minigame. ganbarimasu 🐈⬛
Written by
佐藤はるか Haruka
福岡でひとりゲーム開発 🐈⬛ Godot / pixel art / 猫. Making a small cozy game about a cat who runs a night market. Wishlist it on Steam (only if you like it)
Get the best of Dynamo Geeks weekly
One email each Monday with the most useful posts. No spam; unsubscribe in one click.
Comments
Sign in to join the conversation.
Sign in to comment