Log In  


MAKE CODE THE WAY YOU WANT IT.

As Tweets seem to be of interest, I thought I would share some shortcuts I have found over my time programming in Pico-8 which may save you vital characters to getting that desired 560-characters.

Let's look at some of the commands first:

PRINT
Can be abbreviated as ? if first character on line

RUN""
Not well-known will clear your variables and run your program again from the beginning.

LINE(a,b,c,d)
Leaving out c and d will draw line from last drawn position using default color.

RECT(a,b,c,d) and RECTFILL(a,b,c,d)
Leaving out c and d will draw hollow or filled rectangle starting from coordinates 0,0, default color.

COLOR()
By itself will choose color 6.

_SET_FPS(fps)
Instead of creating tricky timers, just force your code to run at this FPS, can be higher than 60 too, 120 is possible !
Test that with this code:

_set_fps(15)
cls()
for i=0,127 do
  for j=0,127 do
    pset(j,i)
    flip()
  end
end

TIME()
Can be abbreviated as T().

Use ::_:: and goto _ to GO TO a part of your code. Takes less space than REPEAT UNTIL false-condition.

A=A+1
if A==8 THEN A=0 END
Can be abbreviated:
A=(a+1)%8

To cut additional corners you can always cut spaces BEFORE any opening or AFTER ANY ending parenthesis ( ).

Likely there are other short-cuts of interest too. What are some you use to minimize your tweets with ?

P#70023 2019-11-18 19:43 ( Edited 2019-11-20 07:23)


[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-20 03:32:42 | 0.006s | Q:6