Check if a key was pressed this frame (fires once per key press, not continuously).
The key name (e.g. "ArrowUp", "e", " " for space)
True if the key was pressed this frame
if (sg.keyPressed(' ')) { jump(); } Copy
if (sg.keyPressed(' ')) { jump(); }
Check if a key was pressed this frame (fires once per key press, not continuously).