diff --git a/data/scripts/game.lua b/data/scripts/game.lua index 7cf0efe..cde9e42 100644 --- a/data/scripts/game.lua +++ b/data/scripts/game.lua @@ -17,8 +17,11 @@ function process_player(state) input_action { name = "down", control = "S" } input_action { name = "right", control = "D" } - local right = vec3_norm(vec3_cross(state.player.camera_direction, { x=0, y=1, z=0 })) - local up = { x = right.z, y = right.y, z = -right.x } + -- local right = vec3_norm(vec3_cross(state.player.camera_direction, { x=0, y=1, z=0 })) + -- local up = { x = right.z, y = right.y, z = -right.x } + + local right = { x=-1, y=0, z=0 } + local up = { x=0, y=0, z=1 } local direction = { x = 0, y = 0 , z = 0 } @@ -40,6 +43,14 @@ function process_player(state) end state.player.position = vec3_add(state.player.position, vec3_scale(direction, state.player.speed / (60 / state.blast.bpm))) + + local wobble = sinease(24, state.time - state.beat * (60 / state.blast.bpm) , (60 / state.blast.bpm) / 1.5, 0) + + draw_billboard { + texture = "art/creatures/peanut/" .. string.format("dance-%s.png", pingpong(state.beat, 3)), + position = { x = state.player.position.x, y = wobble / 64, z = state.player.position.z }, + size = { x = 1, y = (64 + wobble) / 64 }, + } end function game_tick() @@ -53,7 +64,7 @@ function game_tick() camera_direction = { x=-math.sin(math.pi / 4), y=-1, z=math.cos(math.pi / 4) }, } } - start_blasting("mod171") + start_blasting("mod22") end local state = ctx.udata