a3qz / hag

An ncurses procedurally generated roguelike dungeon crawler
Other
19 stars 18 forks source link

Create controls header #97

Closed JohnathonNow closed 4 years ago

JohnathonNow commented 4 years ago

Right now all of the keys are defined inside main.c. It is probably better to have a separate header that defines each of the controls.

While doing so, the controls could be cleaned up a little. Namely, the debugging cheat key 'c' should probably be removed, as well as the 't' command that is commented out. Additionally, I'm not sure the fallthrough attribute is necessary with the current warning flags, nor what the best practice is surrounding this.

Luis-gd commented 4 years ago

can i take it?

Luis-gd commented 4 years ago

Do you want to make a controls.h to define all the controls and controls.c to create a function for each control?

JohnathonNow commented 4 years ago

Just a header defining some constants is probably fine for now. The movement keys are tricky because we have two sets of them, perhaps something like const int MOVE_W = 'h';
and const int MOVE_W_BABBY = 0xWhateverTheHexCodeForLeftArrowKeyIs;

Luis-gd commented 4 years ago

Ok, understanded

JohnathonNow commented 4 years ago

This seems like it was solved.