Update Home

Spencer Conlon 2025-01-02 18:35:22 +00:00
parent b1724e921c
commit 92a07c3b04

@ -178,6 +178,9 @@ Engine.KeyDown(keyCode)
### Example Usage
```lua
local KeyCode = require("./assets/scripts/keycode")
local Engine= require("./assets/scripts/engine")
function OnUpdate(dt)
-- Check if the "W" key is pressed
if Engine.KeyDown(KeyCode.W) then
@ -188,6 +191,7 @@ end
if Engine.KeyDown(KeyCode.Space) then
print("Space key is pressed")
end
end
```
This function is ideal for handling real-time input, such as moving a character in a game or interacting with UI elements.