diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-11-16 12:45:44 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-11-16 13:03:02 +0100 |
| commit | 975ec3edd112c1a7908c0d97dc49592a22076b71 (patch) | |
| tree | 4298e49593c225ae8ae5be4d4f07f3c7f8b69f07 /event.c | |
| parent | a4fd7a681376899526cfe38c0449f90feb0f582e (diff) | |
| download | cub3d-975ec3edd112c1a7908c0d97dc49592a22076b71.tar.gz cub3d-975ec3edd112c1a7908c0d97dc49592a22076b71.tar.bz2 cub3d-975ec3edd112c1a7908c0d97dc49592a22076b71.zip | |
Basic render of the map
Diffstat (limited to 'event.c')
| -rw-r--r-- | event.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/11/15 06:39:37 by cacharle #+# #+# */ -/* Updated: 2019/11/15 09:27:55 by cacharle ### ########.fr */ +/* Updated: 2019/11/16 12:44:15 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,8 +16,17 @@ int handle_key(int key, void *param) { t_state *state; + /* printf("%d\n", key); */ state = (t_state*)param; if (key == MLXK_ESC) state->running = FALSE; + if (key == MLXK_A) + state->pos.x -= 0.5; + if (key == MLXK_D) + state->pos.x += 0.5; + if (key == MLXK_W) + state->pos.y -= 0.5; + if (key == MLXK_S) + state->pos.y += 0.5; return (0); } |
