jjant/runty8

Why map Z to C?

lesleyrs opened this issue · 4 comments

const K_JUMP: Button = Button::C;
const K_DASH: Button = Button::X;

I don't mind this being a little different than pico8 but changing Z to C already hurts my brain.

jjant commented

Heya!

It's not that I map Z to C, but rather that Pico8 supports both Z and C for the "circle" button, and X and V for the "cross" button, but in the initial implementation I guess I forgot to implement that:

fn key_to_button(key: Key) -> Option<Button> {
match key {
Key::X => Some(Button::X),
Key::C => Some(Button::C),
Key::LeftArrow => Some(Button::Left),
Key::RightArrow => Some(Button::Right),
Key::UpArrow => Some(Button::Up),
Key::DownArrow => Some(Button::Down),
_ => None,
}

I should also rename the variants for clarity:

  • Button::C -> Button::Circle
  • Button::X -> Button::Cross

Oh that makes sense... for some reason I was thinking it was standard to use zx or cv as they're next to eachother but I guess not.

The circle button being mapped to shift-o instead of shift-c makes it a bit more confusing as well, but I get it now.

jjant commented

The circle button being mapped to shift-o instead of shift-c makes it a bit more confusing as well, but I get it now.

Sorry, I didn't get that 🤔 I don't think I did anything with Shift-${key}. Could you elaborate?

That was referring to pico-8 itself, shift-o is the circle button character in their font.