27 lines
461 B
Text
27 lines
461 B
Text
include "../stdlib/stdlib.ayin"
|
|
|
|
let migrate = fn(state) {
|
|
state
|
|
}
|
|
|
|
let setup = fn() {
|
|
return {
|
|
.color: {
|
|
.r: 0,
|
|
.g: 0,
|
|
.b: 100,
|
|
},
|
|
}
|
|
}
|
|
|
|
let update = fn(state, input) {
|
|
let x = if input.gamepad1.dpad.up { 1 } else { 0 } + if input.gamepad1.dpad.down { -1 } else { 0 }
|
|
|
|
let new_blue = state.color.b + x
|
|
|
|
state.color.b = min(255, max(0, new_blue))
|
|
}
|
|
|
|
let draw = fn(state) {
|
|
frame_clear(state.color.r, state.color.g, state.color.b)
|
|
}
|