Vue/Svelte-inspired state management for GameByte UI
// Define reactive state
const state = createState({
coins: 1250,
health: 75,
level: 3
});
// Create UI with declarative config
UI.screen('game-hud', {
layout: 'column',
children: [
{ type: 'resource', icon: 'coin', value: () => state.coins },
{ type: 'progress', value: () => state.health },
{ type: 'button', text: 'Add Coins', onTap: () => state.coins += 100 }
]
});
// State changes auto-update UI
state.coins += 100;