Cursor: Apply local changes for cloud agent

This commit is contained in:
2026-08-09 21:12:57 -07:00
parent 0d4cdbd8ca
commit 0c06d75e86
4 changed files with 317 additions and 8 deletions
+15 -6
View File
@@ -3,7 +3,12 @@ package main
import eng "pkg:engine"
// Many sprites sharing one Character_Data (Flyweight) — good batching demo.
COUNT :: 24
COUNT :: 1000
COLS :: 40
CELL_W :: 20
CELL_H :: 24
ORIGIN_X :: 20
ORIGIN_Y :: 40
main :: proc() {
app: eng.App
@@ -16,18 +21,22 @@ main :: proc() {
sprites: [COUNT]eng.Sprite
for i in 0 ..< COUNT {
col := i % 8
row := i / 8
col := i % COLS
row := i / COLS
pos := eng.Vec2 {
f32(120 + col * 80),
f32(280 + row * 120),
f32(ORIGIN_X + col * CELL_W),
f32(ORIGIN_Y + row * CELL_H),
}
clip := "idle" if (i % 2) == 0 else "walk"
sprites[i] = eng.spawn_sprite(&data, pos, clip, i % 5)
}
// Look at the middle of the grid
app.camera.position = {400, 400}
rows := (COUNT + COLS - 1) / COLS
app.camera.position = {
f32(ORIGIN_X + (COLS - 1) * CELL_W / 2),
f32(ORIGIN_Y + (rows - 1) * CELL_H / 2),
}
last := eng.now_seconds()