23 lines
414 B
Text
23 lines
414 B
Text
let setup = fn() {
|
|
return {
|
|
.color: {
|
|
.r: 0,
|
|
.g: 0,
|
|
.b: 0,
|
|
}
|
|
};
|
|
};
|
|
|
|
let update = fn(state, input) {
|
|
state.color.g = state.color.g + (random_u8() % 3) % 50;
|
|
state.color.b = (state.color.b + 1) % 255;
|
|
return state;
|
|
};
|
|
|
|
let draw = fn(state) {
|
|
frame_clear(state.color.r, state.color.g, state.color.b);
|
|
};
|
|
|
|
let migrate = fn(state) {
|
|
return { .player: { .pos: state.player.position } };
|
|
};
|