Skip to content

Instantly share code, notes, and snippets.

@mach-kernel
Last active February 17, 2018 03:54
Show Gist options
  • Save mach-kernel/340a6dc9bb18ff92c47f173a2e37afed to your computer and use it in GitHub Desktop.
Save mach-kernel/340a6dc9bb18ff92c47f173a2e37afed to your computer and use it in GitHub Desktop.
if(kDown & (KEY_UP)) //Detects if the UP D-PAD button was pressed.
{
for (int current = offs; current <= YEAR_OFFSET; ++current) {
if (current == UNUSED_OFFSET) continue;
bufs[current]++;
if (bufs[current] == maxValue[current]) {
bufs[current] = minValue[current];
}
else { break; }
}
}
if(kDown & (KEY_DOWN)) //Detects if the DOWN D-PAD button was pressed.
{
for (int current = offs; current >= SECONDS_OFFSET; --current) {
if (current == UNUSED_OFFSET) continue;
bufs[current]--;
if (bufs[current] < minValue[current] || bufs[current] >= maxValue[current]) {
bufs[current] = maxValue[current] - 1;
}
else { break; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment