Posting this for anyone who wants to use it. I had made this as practice awhile back and I hate to see the graphics go to waste. Originally I thought maybe I'd make a LITTLE COMPUTER PEOPLE clone (if you remember that for the C64) or some sort of sidescrolling adventure game, or even maybe as a "cheerleader" for a shooter/puzzle type game (she could react to how well or badly you're playing.)
If you download the cart, you'll see that there are 2 sprites with blank faces, a lot of faces for front and profile view (demo only uses 1 face), and a ground tile set, and a flower accessory sprite, and a walking sprite which does have a face.

As I'm getting deeper and deeper into my PICO code, I am finding a few things, and perhaps suggesting some additionally.
Allow FUNCTIONS to be below main code. Many programming languages do not care where you write your functions. It's convenient for me to have them beneath my main code which is the opposite of what PICO requires currently.
Are parentheses really necessary for commands that will always start as the first code ?
PRINT
CLS
I understand it takes two "=" for a comparison. I can think of several programming languages that do not do this. You might keep it as deprecated code, but also allow "=" in a comparison. Quite simply, there should be no need to set a value while making a direct comparison, so "=" could be done this way.
Are parentheses really necessary for other commands ? GFA and BlitzMAX, ONLY used parentheses for functions that return a value or if you wanted to change the order of the operands in a mathematical calculation or a logical comparison. Incidentally, () would never be used except to describe the parameters of a function that does not return a value.
A=ADDUP(16)
CHECKADD A
A=(B+C)*D
CLS clears the whole screen yet ignores CLIP().
A command CLSCOLOR() would be nice to set the CLS color so when it is called, instead of always BLACK, you could have a different color.
Option for LOAD and SAVE state when playing a game from SPLORE. Then you could leave one game, play another. Then go back to the other game at the same position you left it. This would not be cheating as once you SAVE state, you exit that game back to SPLORE.
Only when you load the game again in SPLORE do you have an option to LOAD state and set for the ability to SAVE STATE again. During the game you CANNOT use LOAD state, it is only to recover your position optionally when playing a game.
Instead of an error message stating what line # it occurred on, show an error dialog, perhaps go directly to the editor on the line and column where the error took place along with a dialog box.
Ability to FOLD functions. That is, if you are on the first line of a FUNCTION, you can press F10 or some other select key and it will fold up - not showing the contents and only the name and arguments for it.
FUNCTION ADDUP(N)
RETURN N+1
END
FUNCTION CHECKIT(N)
IF N==0 THEN RETURN -1
END
(2 folded functions)
FUNCTION ADDUP(N)
FUNCTION CHECKIT(N)
Ability to have split edit. That is, you can have one frame above which is at a particular line # in your code and an edit frame below that which can be at an entirely different line #. Useful for debugging complex functions and their calls to main code.
Force readable coding. That is, do not permit this or any other way to convolute coding:
IF (A==5) B=3
Instead it could be:
IF A=5 THEN
B=3
ENDIF
Allow ENDIF as a possible command. END can also be used as a deprecated command, but ENDIF only with an IF statement.
Same with FOR, have a NEXT. Variable name not needed for NEXT, however, unless operating in STRICT mode. (That is something else).
Add a new command, DBUG:
With it, it will choose the top-right-hand corner of the screen and show the variable name + value, updated every time screen is updated:
DBUG A,B,C
A=1
B=A+2
C=10
Display in top-right-hand corner of the screen right-justify flushed during runtime shows:
A=1
B=3
C=10
It could also update every time you call FLIP()
Either that or create a new small panel to the right of the enlarged 128x128 screen and with legible Truetype font and text so it does not interfere at all with the game display.
Use NODBUG to remove a viewed variable during runtime. Exiting a program removes all DBUG variables. Your code MUST have DBUG in order to view them again.
When using UP ARROW for command history when in FILER mode, you could skip over repeated entries. I.E: here is the history
PRINT A,CLS, RUN, CLS, RUN, CLS
Pressing UP will reveal CLS, RUN, but if it is CLS again seeing a repeated pattern, then it will just skip to PRINT A. In fact, there is no reason to save copies of the same command set in history if it is already listed at least once there.
Naturally a repeated command will prompt it to appear at the bottom of history so it is recalled first as it was the last item entered.
NONE of the keys from the keyboard currently work in the PICO editor from NUM-LOCK: HOME, UP, PGUP, LEFT, RIGHT, END, DOWN, PGDN, DEL. I use these all the time in other programming lanuages.
The INSERT KEY is not being used at all. You could use it like SPACEBAR to move typed commands to the right, but instead of the cursor moving additionally, it would stay in the same position, so in effect it just PUSHES what is typed to the right by one-character.
Thus, where the uppercase letter represents the position of the cursor to start, and _ represents the same position of the cursor after pressing INSERT.
ripeApple
ripe_apple
Some commands that I believe would be useful that are not included with PICO:
CHR$(), ASC(), VAL(), STEP, SUBROUTINE, ENDSUB, ENDFUNCTION, PRINT USING,
MKL and CVL to convert 4-bytes to and from a single variable value
PEEKWORD, PEEKLONG, POKEWORD, POKELONG. There may be others.
FILL(X,Y,PaintColor,EdgeColor)
If Paintcolor is not chosen, it uses default color. If Edgecolor is not chosen, it uses any color that is not PaintColor.
add options to CIRCFILL and RECTFILL thus:
CIRCFILL X,Y,Radius(,FillColor,OutlineColor,ThicknessOfOutline)
RECTFILL H,V,X,Y(,FillColor,OutlineColor,Rotation,ThicknessOfOutline)
XRECT H,V,X,Y(,FillColor,OutlineColor,Rotation,ThicknessOfOutline)
(where X & Y are not ending coordinates but pixels across and down)
Same with LINE.
LINE H,V,X,Y(,C,Rotation,Thickness)
XLINE H,V,X,Y(,C,Rotation,Thickness) (where X & Y are pixels across and down, negative for left and up)
LINETO X,Y(,c,Rotation,Thickness) (where the line is drawn directly from the last line drawn and X & Y in this case are not coordinates but pixels adjusted from the last plotted position.
So if you draw a line FROM 50,25 to 100,75 and then used LINETO 0,-10 , the last line drawn will be a vertical one 10 pixels above 75 giving you vertical coordinate 65.
Also add:
OVAL and OVALFILL:
OVAL X,Y,RadiusX,RadiusY,OutlineColor,Rotation,ThicknessOfOutline
OVALFILL X,Y,RadiusX,RadiusY,FillColor,OutlineColor,Rotation,ThicknessOfOutline
Might have ROUND and ROUNDFILL as well, to create Macintosh-style rounded frames.
CurveStep is # of pixels to draw a curve. Zero is none (same as RECT), 1 is 1-pixel, etc. 3 would yield a nice Macintosh style curve.
-- -- -- -- -- -- -- -- ## ## -- -- ## -- -- -- ## -- -- -- -- ## -- -- -- |

PICO-8 v 0.1.9.
I'm using sprite page 3 in my game. I was cleaning up some mockup art by pasting an all-black sprite over the top of the mockup in the sprite editor, but when I flipped back over to the map editor and moved the viewport around, the sprites reverted:
This happens every time I repeat this sequence. The sprites revert if I paste over 1 or all of the mockup.
This doesn't happen when I use the pen tool on the sprites in page 3, nor does it happen when I paste an all-black sprite onto a sprite in page 0:

The new printh() does not sanitise its second argument (the filename) and can thus create or modify user-owned files anywhere on the filesystem. For instance the following code could be put in a cartridge and run on Linux:
printh("echo 'lol'", "../../../.bashrc")
|
It will cause the command to be executed the next time the user logs in (provided they use bash).
A similar technique works on Windows:
printh("@echo lol", "..\\..\\microsoft\\windows\\start menu\\programs\\startup\\script.bat")
|
Many variations of the above are possible and potentially devastating.

This code works as expected:
debug=false
(debug and printh or print)("hello")
print("success")
|
But this gives a runtime error “attempt to call a nil value" at line 4:
debug=false
(debug and printh or print)("hello")
print("success")
(debug and printh or print)("hello again")
|
Confirmed in both 0.1.8 and 0.1.9.

64 values of save data ain't enough for you? Try using this! These functions will allow you to save up to 2,048* values in persistent data! Anyone's free to use it in their own projects; I'm personally releasing this under CC4-BY-SA to allow works using these functions to be sold.
*If you only accepted ON and OFF as acceptable values.
Here's a comprehensive manual on how to use these functions:
[hidden]
============================================================
Pico-8 Binary Functions Set
PRGM ver. 1.1.1
Created by A-zu-ra MANUAL ver. 1.1.2
============================================================
This function set includes functions that will:
- Convert a given integer into a 16-item table of
binary values
- Read a portion of the generated 16-item table
- Insert a given table into another table at any position
- Converts a given table of binary values into an integer
Through these functions, you can essentially use one integer
to serve multiple purposes. This document will not only
cover how the functions work, but also how to apply them in
the context of Pico-8's persistent data.
Included with this function set is a brief test program
showcasing all of the functions in action.
INT COUNT increments once a frame in both whole number
and decimal and is a base for all of the functions in
the test.
BIN START is the START variable of binread.
BIN RANGE is the RANGE variable of binread.
BIN TO INT tests reconversion of binary back to integer.
BIN TO DEC tests reconversion of binary back to decimal.
B2I + B2D is the values of BIN TO INT and BIN TO DEC
as a single value.
RANGE B2I is the integer value of binread.
INSERT B2I is the integer value of binread inserted into
another table via binins.
RANGE B2D and INSERT B2D work the same as RANGE B2I and
INSERT B2I, but for the decimal subset.
The bottom of the function test contains the RAW BINARY of
the integer, as well as the range of binread and starting
point of binins visualized. In the test code is a section
that has EDIT THESE BELOW VALUES! and EDIT THESE ABOVE
VALUES!, so feel free to experiment with the values to get
a better feel of how things go together.
------------------------------------------------------------
inttobin(value, decimal)
value An integer within Pico-8's acceptable range
(-32768 to 32767)
decimal A boolean that decides whether or not to pull
from either whole number or decimal (0 or 1)
RETURNS a table with 16 values of either 0 or 1
This function takes an acceptable value that you give it
and creates a 16-value table, each containing either a
0 or a 1 in it. The following examples are formatted to
be human readable; the order is reversed when the table
is created (i.e. the first example below is, from the
table's perspective, 0000100000000000).
16 0000000000010000
136 0000000010001000
9570 0010010101100010
-32768 1000000000000000
-3530 1111001000110110
------------------------------------------------------------
binread(table, start, range)
table A table generated via inttobin
start The starting point to read from
(remember, tables are 1-indexed)
range How many values from the starting point
to read from
RETURNS a table with a number of values
specified in range
This function takes a table that is generated from
inttobin and extracts a user specified portion of it.
This function requires two more additional values: the
starting point (so you can choose from a different
section of the table), and a range (so you can extract
larger values).
Since the table has the binary values in reverse order,
the function will appear to go from right to left when
imagining the ranges in a human readable order. The
following examples will hopefully give a better visual
of this.
Assume that table is {1, 1, 0, 0, 1, 1, 0, 0,
1, 1, 0, 0, 1, 1, 0, 0}.
(table, 1, 1) S
0011001100110011 bintoint: 1
(table, 1, 5) E S
0011001100110011 bintoint: 19
(table, 4, 7) E S
0011001100110011 bintoint: 102
(table, 9, 4) E S
0011001100110011 bintoint: 3
------------------------------------------------------------
binins(table, table2, start)
table The table you want to append values to
table2 A table generated via inttobin or binread
start What point in the target table to start at
RETURNS the target table with table2 appended to it,
starting from the bit position specified by the user
This function allows you to combine one table into
another at any place. It's advised that you calculate
the size of the table that you want to insert if you
plan on using this function multiple times on one table.
Much like the binread function, the function will appear
to go from right to left when imagining the start point
in a human readable order.
Assume that the target table is empty.
table2 = {1, 0, 0, 1} -- 1001
(table, table2, 1) S
0000000000001001 bintoint: 9
table2 = {1, 0, 1, 0, 1, 1} -- 110101
(table, table2, 4) S
0000000110101000 bintoint: 424
table2 = {0, 1, 1, 0, 1} -- 10110
(table, table2, 7) S
0000010110000000 bintoint: 1408
Remember to calculate your table sizes.
table2 = {1, 0, 1, 1} -- 1101 YES
table3 = {0, 1, 1} -- 110
(table, table2, 3) 3 2
(table, table3, 8) S S
0000001100110100 bintoint: 820
(Both tables added in with no
problems)
Otherwise, calling the function again will overwrite
those bits if the sizes conflict with the positioning.
table2 = {1, 0, 1, 1} -- 1101 NO
table3 = {0, 1, 1} -- 110
(table, table2, 6) 3 2
(table, table3, 8) S S
0000001100100000 bintoint: 800
(Table 3 overwrites last two bits
of table 2)
------------------------------------------------------------
bintoint(table, decimal)
table A table generated via inttobin, binread, or
binins
decimal A boolean that decides whether or not to write
to either whole number or decimal (0 or 1)
RETURNS an integer representation of the binary table
This function will take a binary table that you give it
and convert it back into an integer.
0000000000001000 8
0000000001000010 66
0000101000101000 2600
1000100100001000 -30456
------------------------------------------------------------
How to apply code in context with Pico-8 persistent data
-- Two 8-bit values (43 tokens)
c = {}
v = {6,6}
for i=1,#v do
binins(c,binread(inttobin(v[i],0),1,8),((i-1)*8)+1)
end
f = bintoint(c,0)
(Throw f into persistent data via dset)
To adjust this for other equal bit values, replace B and
adjust the amount of items used in the v table:
for i=1,#v do
binins(a,binread(inttobin(v[i]),1,B),((i-1)*B)+1)
end
#v B Max Leftover bits
16-bit 1 16 65535* None left over
15-bit 1 15 32767 1 bit
14-bit 1 14 16383 2 bits
13-bit 1 13 8191 3 bits
12-bit 1 12 4095 4 bits
11-bit 1 11 2047 5 bits
10-bit 1 10 1023 6 bits
9-bit 1 9 511 7 bits
8-bit 2 8 255 None left over
7-bit 2 7 127 2 bits
6-bit 2 6 63 4 bits
5-bit 3 5 31 1 bit
4-bit 4 4 15 None left over
3-bit 5 3 7 1 bit
2-bit 8 2 3 None left over
1-bit 16 1 1 None left over
*Any number past 32767 will be represented as a negative
value counting towards 0.
-- Different size bit values (47 tokens)
d = {}
s = {5,8}
v = {31,255}
c = 1
for i=1,#v do
binins(d,binread(inttobin(v[i],0),1,8),c)
c += s[i]
end
f = bintoint(d)
(Throw f into persistent data via dset)
To adjust this for other values and bit sizes, ensure that:
- s and v have the same amount of items
- the sum of all numbers in s is less than or equal to 16
- the values in v are within the boundaries of the
respective bit count specified in s
============================================================
Version History
PROGRAM TKN BYTE
v1.1.1 161 418
Optimized inttobin function.
v1.1.0 171 435
inttobin and bintoint can now read from and write
to decimal.
v1.0.0 136 377
Initial release.
*Token and byte values based on the functions alone;
they do not factor in the included function test.
MANUAL
v1.1.2
Modified examples for applying code in context with
Pico-8 persistent data to work with PRGM v1.1.1.
v1.1.1
Changed version number system.
v1.1.0
Added explanation of additional test functions,
as well as new decimal option for inttobin and
bintoint.
v1.0.2
Removed mention of empty table generation in the
function summary.
v1.0.1
Added bintoint readouts on binread and binins.
v1.0.0
Initial manual.
|

Changes 21/09/2016
- Player can attack, killing zombies in two hits
- Bugfix: Health bar is now accurate
- Player animations (Attack, Die)
- Zombie animations (Hit, Die)
- Sounds(Music, player jump, player attack, zombie hit, player hit)
Changes 23/09/2016
- Bugfix, after dying, the death animation does not trigger again when hit
- You are given a message and the ability to reset the game after dying
- Torches are now animated
Changes 07/11/2016
- Enemy archers
- Health pickups
- Collectibles (main game objective)
- New Music
- New sounds
Sadly, I haven't added a boss, but this is what I would call the "finished" product, other than perhaps a nice boss fight.

Hello! Im planning on buying voxatron cause looks sooooooo good! But
Can someone answer me this? If i buy it, it will start downloading on my pc?
I mean, i buy the game then i have it on my PC?
Or how it works? Do i need wi-fi to play it? Like going to the website to play? Please someone answer
I really wanna get out of any doubt, cause 20$ is too expensive and i wanna spend em in a properly way.
Thanks

OVERVIEW
This cart is a bit of a demo of a few shadow methods I've given some thought to. The first two techniques work best at 60fps, but the final technique I think is suitable at any speed.
UPDATE
The original cart had an issue where the "peek/poke merge" technique could not draw starting at odd numbered X coordinates. This has been fixed (but made things a bit more complicated)
METHODS
1 ON/OFF SPRITE:
This method uses a solid shadow sprite that cycles between on/off every frame
2 ALTERNATE PATTERNED SPRITE:
This method uses two sprites with an alternating pattern that is cycled every frame

You're a submarine of a worn-out article.
When ballast isn't taken, you don't sink.
You'll collect all treasures!
[Left][Right] : Move
[Down] : Drop Ballast
[Z] : Game start
I made a simple game for friend who begun to learn Pico-8
foreach isn't used, 306 lines.
バラストを取らないと潜行できないポンコツ潜水艦で宝物を集めよう。
カーソルキー←→ : 移動
カーソルキー↓ : バラストを捨てる。
Z : ゲーム開始
Pico-8を勉強中の知人のためにシンプルなゲームを作ってみました。
foreach不使用。306行のプログラム。

Keep in mind this isn't the pico-8 "crashing" like it's supposed to. This is a full-blown crash crash. Like, "pico-8.exe has stopped working" windows level crash.
It's happening when I call the reload() function with the optional filename argument, regardless of what it is. I tested it with an existing extra cartridge, a non-existing one (as in the filename didn't correspond to anything), and the same cartridge the code was loaded from, which would presumably act exactly like not using the extra argument at all. All crashes.
I even tried using nil instead of a filename, which in lua is the same as not using the argument at all afaik. Still crashed. Despite not using the extra argument in the first place not crashing and working just fine. What?
Here's the code in question:
function load_sprite(rom, ram, cart)
local rom_x = rom % 16
local rom_y = flr(rom/16)
local ram_x = ram % 16
local ram_y = flr(ram/16)
local rom_address = 0x0200*rom_y + 0x0004*rom_x
local ram_address = 0x0200*ram_y + 0x0004*ram_x
for i=0, 7 do
reload(ram_address+0x0040*i, rom_address+0x0040*i, 0x0004, cart)
end
end
function _init()
load_sprite(1, 2)
load_sprite(1, 3, "extra_data")
end
function _draw()
cls()
print("this is a test", 0, 0)
spr(1, 0, 32)
spr(2, 0, 40)
spr(3, 0, 48)
end
|
The following code works:
for i = -32767,-32765 do print(i) end |
-32767 -32766 -32765 |
But this one just does nothing:
for i = -32768,-32765 do print(i) end |
Also, the following code works:
for i = -32765,-32767,-1 do print(i) end |
-32765 -32766 -32767 |
However this one causes an infinite loop:
for i = -32765,-32768,-1 do print(i) end |

This is round 2 of my "template" cartridge for building a basic game with multiple players, screens and additional entities.
I have now added an animation script, which will allow the writer to load in animation sequences (as sprites) ahead of time, and have a simple function called to advance the animation frame at the right time.
Animations can utilize the same sprites in multiple places, control the timing of the animation, and of course loop.
Anyways, I'm building these for my own foundation, but I hope anybody else can get some knowledge from them.
P.S. this cart uses Lua's fancy "multiple return values" feature, which now that I understand, is like a super power.
UPDATE:
version 1.4 - 2018
Major update!
- fixed major bugs concerning player alignment on the map (for real this time)
- updated the title screen - it's flashier now
- added more sound effects and audio cues
- added more dialogue with more NPCs to talk to
- some NPCs now say different things depending on player progress
- sprinkled in a couple new easter eggs
version 1.26 - 2016
- added missing image flip when turning left towards obstacles. Thanks to dw817 for pointing that out.
version 1.25 - 2016
- minor improvements to marinara behaviors
- fixed some positioning issues
- made an in-game tip easier to discover
- final boss is now slightly harder
version 1.2 - 2016
- Fixed slime behaviors. They no longer scale the walls when blocked in by the crate. Thanks to dw817 for pointing that bug out!
version 1.1 - 2016
- Fixed problem where entering the pizzeria caused the player to lose alignment with game map.
- Fixed some grammatical errors.
- moved a dungeon key slightly so it's more visible.
Controls:
Btn 4 (Z) to pull crate or turn 180(when not next to crate)
Btn 5 (X) to use weapon
This game took about a month to make. It's similar to my last game, EGGHUNT, in terms of the layout and walking, but is much more complex as this game has enemy AI, weapons, and crate pushing.
ENJOY!






2 comments


