working camera
This commit is contained in:
@ -11,14 +11,14 @@ static void ingame_tick(struct state *state) {
|
||||
world_drawdef(scn->world);
|
||||
player_calc(scn->player);
|
||||
|
||||
static t_camera cam = { .pos = { 0 }, .target = { 0, 0, -1 }, .up = { 0, -1, 0 }, .fov = (float)M_PI_2 };
|
||||
static t_camera cam = { .pos = { 0, 0, 1 }, .target = { 0, 0, -1 }, .up = { 0, 1, 0 }, .fov = (float)M_PI_2 };
|
||||
|
||||
if (input_is_action_pressed(&ctx.input, "player_left"))
|
||||
cam.pos.x -= 0.01f;
|
||||
if (input_is_action_pressed(&ctx.input, "player_right"))
|
||||
cam.pos.x += 0.01f;
|
||||
if (input_is_action_pressed(&ctx.input, "player_jump"))
|
||||
cam.pos.z -= 0.01f;
|
||||
cam.pos.z += 0.01f;
|
||||
|
||||
m_sprite(m_set(path, "/assets/light.png"),
|
||||
m_set(rect, ((t_frect){ 48, 64, 64, 64 })),
|
||||
|
Reference in New Issue
Block a user