[nostalgia/core] Add Context buttonDown function

This commit is contained in:
2022-02-13 02:21:38 -06:00
parent 0e7a090d28
commit 41cebff5fc
4 changed files with 9 additions and 10 deletions

View File

@@ -10,14 +10,14 @@ static unsigned spriteX = 72;
static unsigned spriteY = 64;
static int eventHandler(core::Context *ctx) noexcept {
if (core::buttonDown(core::GamePad_Right)) {
if (core::buttonDown(ctx, core::GamePad_Right)) {
spriteX += 2;
} else if (core::buttonDown(core::GamePad_Left)) {
} else if (core::buttonDown(ctx, core::GamePad_Left)) {
spriteX -= 2;
}
if (core::buttonDown(core::GamePad_Down)) {
if (core::buttonDown(ctx, core::GamePad_Down)) {
spriteY += 2;
} else if (core::buttonDown(core::GamePad_Up)) {
} else if (core::buttonDown(ctx, core::GamePad_Up)) {
spriteY -= 2;
}
constexpr auto s = "nostalgia";