Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+2)

You're right, pmem() saves 32 bit integers. (https://github.com/nesbox/TIC-80/wiki/pmem )

The obvious workaround is to use 0 and 1 (or non-zero) to represent false/true but of course your code will need to be adapted to take that into account.

You could define (uppercase!) 'constants' at the start of your program and use them throughout:

local FALSE, TRUE = 0, 1

if flag==TRUE then...

Or you could just modify your 'if' statements: if flag==true then... becomes if flag==1 then...

Alternatively, you could create a function to examine the value and return true/false if that's essential for some reason. eg

function bool(i)
 if i==0 return false else return true end
end

and use it in your 'if' statements... if bool(flag) then.... but this adds the overhead of a function call for every use.

The best solution really depends on how/how frequently the values are used. Hope that gives you some ideas , sorry if you know all this already and just wanted to a basic answer (which is 'No') :D

(+1)

Well you're right, I already knew that XD, I just didn't want to stop using boolean variables because sometimes I write a "NOT" for boolean variables in a statement, which doesn't work with numbers ;_;, but ok I'll go reshape my code thanks for answering me =)

(+2)
if not(a==1) then...

works :D

(+1)