Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

TIC-80

Fantasy computer for making, playing and sharing tiny games. · By Nesbox

Question about btnp behaviour

A topic by Arthur Ferrai created Aug 03, 2017 Views: 318
Viewing posts 1 to 1

I'm testing btnp using the following snippet:

function TIC()
 cls(0)
print(tostring(btnp(0,120,60))) end

"print" function renders these things:

  1. "false" on program start, key released;
  2. "true" on the frame I pressed the key;
  3. "false" for 2 seconds, key still pressed;
  4. "true" for 1 frame, key still pressed;
  5. "false" for 1 second, key still pressed;
  6. back to item 4 until I release the key;
  7. key pressed again, flows goes back to 2.

Is this the expected behaviour? Shouldn't step 2 return "false"?