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

how to sense if a button Is NOT pressed?

A topic by jackj106 created Sep 06, 2017 Views: 879 Replies: 2
Viewing posts 1 to 3

how would i go about sensing if a button is not pressed at all?

In Lua it's pretty simple -- just the 'not' keyword.

if not btn(n) then
  --True if btn n is NOT pressed
end

Whether to find out whether at least one button is pressed:

if (btn() ~= 0) then 
  -- True if any button is pressed
end