Log In  
Follow
YellowAfterlife

Seems like a common request for functions to convert to and from char codes.
Time will show whether it shall be added to the program, but until then you can do it by yourself:

Initialization (59 tokens, 197 bytes):

chars=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
-- '
s2c={}
c2s={}
for i=1,95 do
 c=i+31
 s=sub(chars,i,i)
 c2s[c]=s
 s2c[s]=c
end

(the blank comment is there solely to keep the editor from glitching out due to lack of escape sequence support)
After this is executed, you'll find yourself with having two tables - s2c, holding char->code pairs, and c2s, holding code->char pairs.
Since using these directly can be slightly less comfortable, here are a couple helper functions:

chr(code) : Returns the char (string) for the given code [13tk\36b]:

function chr(i)
 return c2s[i]
end

Example: chr(33) == "!"

[ Continue Reading.. ]

10
2 comments



Cart #12468 | 2015-08-08 | Code ▽ | Embed ▽ | No License
5


Can be combined with global palette to create objects that can only be seen in close promixity.
Somewhat bearable performance-wise.
Haxe source: https://gist.github.com/anonymous/c885964ca61431a8e90a

5
0 comments



Blog post: http://yal.cc/introducing-hxpico8/
Repository: https://github.com/YellowAfterlife/hxpico8
Examples: https://github.com/YellowAfterlife/hxpico8xm

In short, this project permits to use Haxe programming language to create programs for PICO-8 (by transpiling Haxe into PICO-8's flavour of Lua).
This grants you classes, compile-time optimizations, constant and function inlining, and a whole bunch of other "syntactic sugar" features while keeping the output size reasonably small.
For example, this class compiles to this .p8.
Obviously, you can do more complex things with it too.

Have fun :)

6
2 comments



Cart #12242 | 2015-08-04 | Code ▽ | Embed ▽ | No License
28


This is a small demo that I've been showing on Twitter/Tumblr yesterday. Currently there isn't much going on other than concept demonstration (and most of "engine" code needed). The code is laid out to allow taking it in various directions from here.
Source code

28
7 comments



Seeing screenshots of 3d[-ish] games here and there, a question arises - how does one draw filled triangles, and does so efficiently? I have tried porting one-before-last-step algorithm from here:
http://forum.devmaster.net/t/advanced-rasterization/6145
which resulted in this little monstrous function:
https://gist.github.com/YellowAfterlife/34de710baa4422b22c3e
but, alas, the math is just too much - it can barely draw half of screen worth of triangles before CPU use reaches 1.0. And that's before there's even any game!
I'd appreciate some pointers towards algorithms more suitable for pico-8. Or any help, really.

2
2 comments



Cart #11747 | 2015-07-21 | Code ▽ | Embed ▽ | No License
12


If you want to be able to change text color halfway through without splitting into multiple commands, here's just that at a price of 150 tokens / 265 compressed chars.
So doing
printc("hello ^8world^7!", 4, 4)
will output

Could have been a bit smaller if there were functions to convert string to/from charcode.

12
5 comments



Cart #10855 | 2015-05-22 | Code ▽ | Embed ▽ | No License
3


Update: Actually, why not go a bit further, and create a code viewer. Includes a custom font by me.

Cart #10853 | 2015-05-22 | Code ▽ | Embed ▽ | No License
3


A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output.

This achieved by having the program modify it's own source and re-launch via the "run" command.
Essentially it does this:

print([[
(original program source here)
]])
3
1 comment



It would make sense if dragging a .p8/.p8.png onto pico-8 ("pico8 file_path") would cause it to cd to the containing directory, load the cart, and run it. In particular, this would allow to associate pico-8 with the .p8 format and/or start it from external applications (e.g. to use Notepad++/Sublime Text for editing code and have a key to launch pico-8 with the current file loaded).

1
1 comment



Cart #10437 | 2015-05-03 | Code ▽ | Embed ▽ | No License
106


Stories at the dawn is a short minimalistic platformer game that I've made over the weekend.
There is a [small] world to explore and multiple endings to uncover.

The game is currently silent as I currently do not have enough experience to create anyhow worthy audio. If you feel like you can do something about that, feel free to message me or tinker with the game file (I have tried to add sufficient amounts of comments).

If you liked the game, you can also support it via the itch.io page.

106
14 comments



Web: https://dl.dropboxusercontent.com/u/3594143/yal.cc/r/picodoc/index.html

I've made a small cheat sheet/API reference thing for pico-8's standard functions.
It provides a list of names+arguments, and you can click to expand/collapse sections/function descriptions:

Generally intended to greatly reduce the amount of scrolling back and forth while looking things up.

18
4 comments



Cart #10310 | 2015-04-29 | Code ▽ | Embed ▽ | No License
10


A pretty standard Tetris example.
Scoring, colors, soft drops, wallkicks.
Contains some comments on the process.
No audio as I have not figured that out so far.

10
0 comments