~rabbits/hiversaires

157d8d8d0ae21ac10ef4aa8bc731fda9449038de — neauoire 2 years ago 084253b
Added wasd controls
3 files changed, 10 insertions(+), 5 deletions(-)

M README.md
M src/input.c
M src/playground.c
M README.md => README.md +1 -1
@@ 56,7 56,7 @@ Supported arguments are:
### Meta

- `R` Press and hold to reset the game
- `A` Press and hold to run the game on auto-pilot; let go to return to manual control
- `Q` Press and hold to run the game on auto-pilot; let go to return to manual control

### Debug


M src/input.c => src/input.c +5 -1
@@ 45,12 45,16 @@ processKey(SDL_Keycode sym, int down)
	case SDLK_9:
	case SDLK_KP_9: inputType = DEBUGINPUTTYPE_UNLOCK_DOORS; break;
#endif
	case SDLK_a:
	case SDLK_LEFT: inputType = INPUTTYPE_LEFT; break;
	case SDLK_d:
	case SDLK_RIGHT: inputType = INPUTTYPE_RIGHT; break;
	case SDLK_w:
	case SDLK_UP: inputType = INPUTTYPE_CENTER; break;
	case SDLK_s:
	case SDLK_DOWN: inputType = INPUTTYPE_BACK; break;
	case SDLK_r: inputType = INPUTTYPE_RESET; break;
	case SDLK_a: inputType = INPUTTYPE_WALKTHROUGH; break;
	case SDLK_q: inputType = INPUTTYPE_WALKTHROUGH; break;
	default: found = 0; break;
	}


M src/playground.c => src/playground.c +4 -3
@@ 169,18 169,19 @@ processEvent(SDL_Event *event)

	case SDL_KEYDOWN:
		switch(event->key.keysym.sym) {
		case SDLK_a:
		case SDLK_LEFT:
			printf("LEFT\n");
			break;

		case SDLK_d:
		case SDLK_RIGHT:
			printf("RIGHT\n");
			break;

		case SDLK_w:
		case SDLK_UP:
			printf("UP\n");
			break;

		case SDLK_s:
		case SDLK_DOWN:
			printf("DOWN\n");
			break;