Skip to content

Commit

Permalink
Rename keyboard state method in the Lua game version
Browse files Browse the repository at this point in the history
  • Loading branch information
encelo committed Feb 14, 2025
1 parent bb7f077 commit 1de387e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ncpong.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ function ncine.on_frame_start()
local ball_pos = nc.sprite.get_position(ball_)
local ball_size = nc.sprite.get_size(ball_)

if nc.input.key_down(key_state, nc.keysym.UP) or nc.input.key_down(key_state, nc.keysym.W) then
if nc.input.is_key_down(key_state, nc.keysym.UP) or nc.input.is_key_down(key_state, nc.keysym.W) then
if should_kickoff_ then
kickoff()
end
target_y_ = blue_stick_pos.y + 1
elseif nc.input.key_down(key_state, nc.keysym.DOWN) or nc.input.key_down(key_state, nc.keysym.S) then
elseif nc.input.is_key_down(key_state, nc.keysym.DOWN) or nc.input.is_key_down(key_state, nc.keysym.S) then
if should_kickoff_ then
kickoff()
end
Expand Down

0 comments on commit 1de387e

Please sign in to comment.