🎮 Simple Entity System
Spawn sprites and labels with unique IDs. Get and set properties dynamically. Find entities by tags for batch operations.
Build games fast with Lua scripting in Godot
function on_init()
-- Create a player sprite
vibe.spawn("sprite", {
texture = "res://player.png",
x = 100, y = 100, tag = "player"
})
-- Add a score display
vibe.spawn("label", {
text = "Score: 0",
x = 10, y = 10, tag = "ui"
})
end
function on_tick(dt)
-- Move with arrow keys
local h = vibe.axis("horizontal")
local players = vibe.find("player")
if #players > 0 then
local x = vibe.get(players[1], "x")
vibe.set(players[1], "x", x + h * 200 * dt)
end
-- Play sound on space
if vibe.key("space") then
vibe.play_sfx("res://jump.wav")
end
end