fogleman / Minecraft

Simple Minecraft-inspired program using Python and Pyglet
MIT License
5.22k stars 1.23k forks source link

Keyboard-only support #82

Open tleeuwenburg opened 7 years ago

tleeuwenburg commented 7 years ago

I'm not sure if other minecraft clones do this, but it has always bugged me that you seemingly have to use a mouse. What do other people think of adding keyboard controls for changing the view axes (look/turn up, down, left, right) plus create and remove blocks (left/right mouse)?

fire-eggs commented 7 years ago

Keyboard controls 100%! For reasons I don't (yet) understand, when I attempt to change perspective using the mouse, it goes ballistic and I'm almost nauseous. (Win7 virtual machine, Python 2.7, pyglet 1.2.4)

A 'step' value of 15 degrees seems to be an effective value when I added rotation via the keyboard. It's a little tricky to focus on the exact desired 'target' facet of a cube but is manageable. 'C' for create-block and 'R' for remove-block are reasonable mappings.

I'm pondering extending the label to show the 'current' block type and flight mode, as I can't seem to keep track of these mentally ...

prail commented 7 years ago

Maybe reuse the current mouse control code and just implement arrow key control over its X and Y?