xiaohongshu
xiaohongshu
game-generator
Generate GameSpec JSON and Lua scripts for the AI Game Platform. Use when creating games, adding features like player movement, enemies, collectibles, or fixing Lua script issues. Supports FPS, 2D side-scrollers, and 3D platformers.
Full skill instructions
Assists in generating valid GameSpec JSON + Lua scripts for the AI Game Platform.
Identify the game type:
{
"meta": { "title": "Game Title", "version": "1.0.0" },
"players": { "min": 1, "max": 1, "spawn_points": [{ "x": 0, "y": 1, "z": 0 }] },
"worlds": [{
"id": "world-1",
"name": "Main World",
"environment": {
"ambient_light": { "color": "#ffffff", "intensity": 0.5 },
"directional_light": { "color": "#ffffff", "intensity": 1, "position": { "x": 10, "y": 10, "z": 10 } }
},
"objects": [/* GameObjects */]
}],
"scripts": [/* Lua scripts */]
}
Each GameObject needs:
"obj-player-1", "obj-enemy-1"{
"type": "mesh",
"properties": {
"geometry": "box|sphere|plane|cylinder",
"color": 0xff0000,
"width": 1, "height": 1, "depth": 1,
"hasCollision": true,
"collisionShape": "box|sphere|auto",
"isTrigger": false
}
}
IMPORTANT: Set hasCollision: true for physics interaction!
{
"type": "camera",
"properties": {
"fov": 75,
"isMainCamera": true,
"usePointerLock": false // true for FPS, false for 2D/platformer
}
}
function on_update(dt)
-- ALWAYS use this pattern:
local pos = gameobject.transform.position
pos.x = pos.x + speed * dt
gameobject.transform.position = pos -- Must reassign!
end
function on_update(dt)
if not input then return end -- Optional safety check
if input["w"] or input["arrowup"] then
-- Move forward
end
if input[" "] then -- Space key
-- Jump
end
end
Available Keys:
input["w"], input["a"], input["s"], input["d"]input["arrowup"], input["arrowdown"], input["arrowleft"], input["arrowright"]input[" "] (space), input["shift"], input["control"]local velocity_y = 0
local was_space_pressed = false
function on_update(dt)
if not input then return end
local is_space_pressed = input[" "] == true
if is_grounded and is_space_pressed and not was_space_pressed then
velocity_y = jump_force
end
was_space_pressed = is_space_pressed
velocity_y = velocity_y + gravity * dt
pos.y = pos.y + velocity_y * dt
end
function on_update(dt)
local player = find_gameobject("Player")
if player then
local dx = player.transform.position.x - gameobject.transform.position.x
-- Use dx for AI, camera following, etc.
end
end
function on_collision(other)
-- Solid collision (walls, floor)
if other.name == "Wall" then
print("Hit wall")
end
end
function on_trigger_enter(other)
-- Trigger collision (items, goals)
if other.name == "Coin" then
print("Collected!")
end
end
local velocity_y = 0
local gravity = -15
local jump_force = 7
local move_speed = 5
local is_grounded = false
local was_space_pressed = false
function on_update(dt)
if not input then return end
local pos = gameobject.transform.position
-- Horizontal movement
if input["arrowleft"] or input["a"] then
pos.x = pos.x - move_speed * dt
end
if input["arrowright"] or input["d"] then
pos.x = pos.x + move_speed * dt
end
-- Jump
local is_space_pressed = input[" "] == true
if is_grounded and is_space_pressed and not was_space_pressed then
velocity_y = jump_force
is_grounded = false
end
was_space_pressed = is_space_pressed
-- Gravity
velocity_y = velocity_y + gravity * dt
pos.y = pos.y + velocity_y * dt
-- Ground check
if pos.y <= 0.6 then
pos.y = 0.6
velocity_y = 0
is_grounded = true
end
gameobject.transform.position = pos
end
local rotation_y = 0
local mouse_sensitivity = 0.002
function on_update(dt)
if mouse_movement then
rotation_y = rotation_y - mouse_movement.x * mouse_sensitivity
end
gameobject.transform.rotation.y = rotation_y
end
Camera must have: "usePointerLock": true
local patrol_distance = 3
local start_x = 0
local direction = 1
local speed = 2
function on_start()
start_x = gameobject.transform.position.x
end
function on_update(dt)
local pos = gameobject.transform.position
pos.x = pos.x + direction * speed * dt
if pos.x > start_x + patrol_distance then direction = -1 end
if pos.x < start_x - patrol_distance then direction = 1 end
gameobject.transform.position = pos
end
local rotation_speed = 3
local collected = false
function on_update(dt)
if collected then
gameobject.transform.position.y = -100 -- Hide
return
end
local rot = gameobject.transform.rotation
rot.y = rot.y + rotation_speed * dt
gameobject.transform.rotation = rot
end
function on_trigger_enter(other)
if other.name == "Player" and not collected then
collected = true
print("Collected!")
end
end
Before generating GameSpec:
isMainCamera: trueusePointerLock (true for FPS, false for 2D)hasCollision: trueisTrigger: trueif not input then return endgameobject.transform.position.x = x + 1 → ✅ Use local variable patternhasCollision: true → Objects pass through each otherusePointerLock: true for 2D games → Breaks keyboard inputdt → Frame-rate dependent movementFor detailed API reference, see:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience