Log In  
Log In  

@samhocevar

Follow
Follow

Cart [#calculator-0#] | 2018-12-05 | License: CC4-BY-NC-SA | Embed
1

Just a work in progress. The parser is not perfect but it needs a lot of work.

P#59724 2018-12-05 19:01

This code does not work (unexpected symbol near 'then'):
if (x == "\\") then print(x) end

But this works OK:
bs = "\\" if (x == bs) then print(x) end

P#59713 2018-12-05 14:31

Cart [#rainbow_cats-2#] | 2018-12-04 | License: CC4-BY-NC-SA | Embed
5

Your kittens are in danger! How could they survive in such a crazy world?

You must return them home safely. Select the color of the kittens you wish to call and they will follow you everywhere.

Controls:

  • Navigation and player controls: arrows
  • Call your kittens: X
  • Validation and jump: Z or W

This is the entry for Ludum Dare 43 we made with @Niarkou.

P#59669 2018-12-04 13:08 ( Edited 2018-12-04 16:55)

Cart [#59084#] | 2018-11-16 | No License | Embed

This is my entry for #TweetTweetJam: an unfinished shooter, in about 530 characters of code.

Left/right to move, X to shoot.

It has music and SFX and many things but no actual gameplay.

Jam entry page: https://itch.io/jam/tweettweetjam/rate/331412

P#59086 2018-11-16 18:06 ( Edited 2018-11-16 23:44)

I noticed that if there is a file named "splash.png" in PICO-8’s directory, it will be displayed at launch before the boot sequence. This also works with cartridges exported as binary.

P#55229 2018-08-16 04:20 ( Edited 2018-08-26 15:28)

Cart [#55138#] | 2018-08-14 | License: CC4-BY-NC-SA | Embed
5

My love Niarkou and I made this for Ludum Dare in 72 hours!

Objectives: Feed your cats by filling their bowls. The more they eat, the more points you get! But too many cats and you will run out of space.

Controls:

  • Pause: P or Enter
  • Navigation / Player controls: ◀ ▲▼ ▶
  • Menu validation / Take something / Pour something into the bowl: W / Z
  • Throw away something: X

LDJam link: https://ldjam.com/events/ludum-dare/42/cat-lady-simulator

P#55104 2018-08-13 19:47 ( Edited 2018-08-23 11:44)

I was working on this a while ago and haven’t found much time for it lately, but I thought it could be interesting to some people. It is a fork of Lua that implements the PICO-8 dialect.

Why?

If you know how to embed Lua somewhere, then there are chances that you can embed PICO-8 compatible Lua instead! I use it for an unfinished toy emulator project.

Features

  • short if syntax (on one line)
  • short print syntax (? at the beginning of a line)
  • compound assignment operators: += /= etc.
  • C style not equal operator: !=
  • C++ style comments with //
  • fixed-point arithmetic with overflows, infinity etc.
  • the PICO-8 math library (shr, atan2, flr etc.)
  • binary literals: 0b1001001.10010
  • works in Windows and Linux, and probably in OS X too

How?

The usual approach to the language extensions is through code parsing and patching. For instance, replacing all occurrences of <something>+=<blah> with <something>=<something>+(<blah>). This is what PICO-8 itself does, which is why it still has the occasional weird parsing issues (you can write x=0y=1 but not x+=0y=1). My approach is to implement these extensions in the Lua parser instead, which is elegant, more robust, and gives better error reporting.

Where?

It’s on GitHub: https://github.com/samhocevar/z8lua

Example

Here is a z8lua session in my terminal; you can see familiar PICO-8 syntax in here:

P#54527 2018-07-30 07:38 ( Edited 2018-07-30 11:38)

Cart [#54521#] | 2018-07-29 | License: CC4-BY-NC-SA | Embed
1
We made this game over the weekend as some practice for Ludum Dare. It is named after one of our cats.

Controls: left/right to move, X to fire.

P#54522 2018-07-29 17:18 ( Edited 2018-07-30 06:00)

Cart [#47450#] | 2017-12-16 | No License | Embed
9

I was working on this during Ludum Dare 39 (4 months ago) but never got the courage to finish it… maybe one day!

P#47451 2017-12-16 17:17 ( Edited 2018-01-26 01:01)

Cart [#46976#] | 2017-12-04 | License: CC4-BY-NC-SA | Embed
12

Made for Ludum Dare. It’s 2 minutes before the deadline, I need some sleep now.

P#46977 2017-12-03 20:59 ( Edited 2017-12-10 16:02)

Cart [#33419#] | 2016-12-13 | License: CC4-BY-NC-SA | Embed
23

A mini adventure game.

This cartridge extensively abuses Lua memory, lossy zlib compression, data-stored-in-code, and dget to render a 600×252 image with pixel-perfect scrolling. This is more a tech demo but I ended up doing a full mini game for Ludum Dare 37.

I’ll write a postmortem to explain all the hacks.

P#33420 2016-12-12 22:29 ( Edited 2017-10-03 14:49)

This function abuses Unicode and ANSI color codes to output a screenshot of the current screen to a text terminal such as xterm. You can record the PICO-8 rendering and replay it using “cat”! You can run PICO-8 over ssh! You can be anything you want.

I also set up a telnet service demonstrating the feature:

telnet lol.pm 12345

Here is how it looks like; this is PICO-8 (small window) launched from GNOME Terminal (large window) just after screenshot() was called:

And here is the code:

pico-8 cartridge // http://www.pico-8.com
version 8
__lua__
-- screenshot to console
-- by sam hocevar

function screenshot()
 local l={ 16, 17, 89, 29, 131, 240, 251, 230, 197, 214, 220, 47, 39, 103, 211, 223 }
 local e="\027["
 printh(e.."?25l") -- hide cursor
 for y=0,63 do
  local ofg,obg=-1,-1
  local s=e..(y+1)..";1\072" -- uppercase h
  for x=0,127 do
   fg,bg,ch=pget(x,y*2),pget(x,y*2+1),"\226\150\128"
   if bg>fg then
    fg,bg,ch=bg,fg,"\226\150\132"
   end
   if fg!=ofg or bg!=obg then
    s=s..e
    local t=""
    if (bg!=obg) s,t=s.."48;5;"..l[bg+1],";"
    if (fg!=ofg) s=s..t.."38;5;"..l[fg+1]
    s=s.."m"
   end
   s=s..ch
   ofg,obg=fg,bg
  end
  printh(s..e.."0m"..e.."\075") -- uppercase k
 end
 printh(e.."?25h") -- show cursor
end

The terminal must be UTF-8 and 256-color aware, so this will probably work in most Linux and OS X terminals. On Windows I could test it successfully with the MSYS2 terminal.

P#29661 2016-09-29 08:15 ( Edited 2016-09-29 18:30)

Cart [#27684#] | 2016-08-30 | License: CC4-BY-NC-SA | Embed
4

Will not work well on slow machines or in the web player.

I’m toying with both hi-color images (using 60Hz flickering) and data compression, this is my first attempt. The image size is 128×188.

The picture is of course a tribute to the Deluxe Paint series!

P#27685 2016-08-29 20:26 ( Edited 2016-08-30 01:12)

X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2018-12-13 16:02 | 0.118s | 4194k | Q:135