Log In  
Follow
ultrabrite
SHOW MORE

While enabling mouse input:

POKE(0x5F2D, flags) -- where flags are:
0x1 Enable
0x2 Mouse buttons trigger btn(4)..btn(6)

STAT(34) -- Mouse buttons (bitfield) with
0x1: Left
0x2: Right
0x4: middle

poke(0x5f2d, 3)

function _update()
 if (stat(34)==1) print("l")
 if (stat(34)==2) print("r")
 if (stat(34)==4) print("m")
 if (btn(4)) print(4)
 if (btn(5)) print(5)
 if (btn(6)) print(6)
 if (btn(🅾️)) print('🅾️')
 if (btn(❎)) print('❎')
end

Left mouse button (1) triggers button 5 (❎)
Right mouse button (2) triggers button 4 (🅾️)
Shouldn't this be the other way round?

P#106924 2022-02-14 22:35 ( Edited 2022-02-14 22:36)

SHOW MORE

This cart runs ok at first but fails when returned to from the breadcrumb.

Cart #fohekireba-0 | 2021-09-05 | Code ▽ | Embed ▽ | No License

code:

::_::
    cart='#'
    for i=1,5 do
        cart=cart..flr(rnd(10)) 
    end
    cls()
    print(cart,64-#cart*2,4)
    flip()
    load(cart,"leave "..cart)
goto _

There's no newline after "goto _", adding one fixed the issue.
This only happens on the bbs.

P#96917 2021-09-05 23:02

SHOW MORE

Cart #podofimose-0 | 2021-02-20 | Code ▽ | Embed ▽ | No License
12

Just a quick experiment, slightly related to magnetic fields around wires and strange attractors.
10 minutes coding and hours contemplating...

Have fun!

../..

Lorenzo 2! The result might be different but for the same reasons.

Cart #mujazepafo-0 | 2021-04-23 | Code ▽ | Embed ▽ | No License
12

(x): reset
(o): toggle trace

P#87946 2021-02-20 20:07 ( Edited 2021-04-23 18:36)

SHOW MORE

This template enables mouse pointer locking thanks to the JavaScript Pointer Lock API & Pico-8's GPIO system. The mouse pointer will get locked inside the pico-8 frame, while still providing movement deltas from your mouse. Now you can do a proper Marble Madness or Quake remake!

here's a demo cart (also included in the zip below):

Cart #fotubigibu-0 | 2020-05-05 | Code ▽ | Embed ▽ | No License
11

Of course it doesn't work as advertised here on the bbs, nor within the pico-8 binary. You'll get stuck when the pointer quits the frame.

  1. unzip ubmlock.zip in your template dir:
    Windows: C:/Users/{Yourname}/AppData/Roaming/pico-8/plates
    OSX: /Users/{Yourname}/Library/Application Support/pico-8/plates
    Linux: ~/.lexaloffle/pico-8/plates

  2. load the cart in pico (fotubigibu until I figure out how to change its name. I kinda like it though):
    load #fotubigibu-0
  3. export as html, using the above template:
    export mlockdemo.html -p ubmlock
  4. have a taste of freedom!

The mouse handling code is in the first tab:

mouse.lockable : true when the cart is run from the proper html template, false otherwise
mouse.locked : true when the mouse is actually locked within the web browser, false otherwise
(for instance you might want to pause and print a message for the user to click back)
mouse.dx, mouse.dy : mouse deltas!
mouse.x, mouse.y : mouse coordinates, still updated and available for your menus even when the mouse is locked

note that you'll need to call mouse:update() every frame to... update the stuff above!
also the mouse buttons and wheel are not handled here, but still available through the usual stat()

when not lockable there's a fallback to standard mouse input while still trying to provide deltas, for dev purpose, with the result you can see above.

Free to use and modify, no attribution required, have fun!

P#75853 2020-05-05 17:21 ( Edited 2020-09-10 08:44)

SHOW MORE

they're clamped to color 15 it seems.
not a big deal, but maybe it's an easy fix?

P#75852 2020-05-05 15:21

SHOW MORE

this happened to me a couple of times in the last few days, and just now: I left pico-8 running (not a cart, console prompt) and found it completely irresponsive after something like two hours...

windows 10, pc didn't go to sleep (I usually manually Win+L, but not those times)
edit: 0.2.0d - missed an update ;)

P#75800 2020-05-04 19:26 ( Edited 2020-05-04 19:30)

SHOW MORE

Cart #bowobah-0 | 2019-09-18 | Code ▽ | Embed ▽ | No License
32

Wandering carelessly through space you get swallowed by b'Ah, the semi-sentient semi-cybernetic semi-grumpy semi-planetoid! Now fight your way to its other end (there's one)!

Still in need of some polish here and there but (hope)fully playable, so here it is!

(edit) moved from w.i.p. to cartridges after all. some update still coming up later on...

P#67874 2019-09-18 22:57 ( Edited 2019-12-22 12:49)

SHOW MORE

just a very old very unfinished project, not playable but small and hopefully readable.
free to use and modify or take from, make something awesome and have fun!

Cart #pong3d-0 | 2019-08-23 | Code ▽ | Embed ▽ | No License
1

P#66882 2019-08-23 12:24

SHOW MORE

standard version (export from 0.1.11g):
https://www.lexaloffle.com/bbs/files/13845/crt_template.zip

unzip crt.html to {application data}/pico-8/plates
then
EXPORT GAME.HTML -P CRT

alternate version (see here):
https://www.lexaloffle.com/bbs/files/13845/ubcrt_template.zip

Feel free to use & modify, no attribution required.

Have fun!

P#62468 2019-03-03 21:47 ( Edited 2019-04-25 11:32)

SHOW MORE

Cart #55065 | 2018-08-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Connect the pipes!
There's an auto-connect feature to help you (most of the time). It can be disabled through the pause menu.
Reset the cart to replay a game (sorry!)

Early but old wip, I don't think I'll have time to work on it for a while so here it is, instead of gathering dust all alone.

P#55066 2018-08-13 10:39 ( Edited 2018-08-15 08:13)

SHOW MORE

Cart #yunotuhabi-0 | 2020-10-30 | Code ▽ | Embed ▽ | No License
2

This was inspired by a minesweeper puzzle I saw in a paper magazine years ago.

  • tag bombs with (X). once you've tagged 20 cells the board is revealed
  • tag free cells in green with (O) (in easy mode only)
  • the bomb count does not include the cell itself (a '0' cell can contain a bomb)

  • new version with mouse support (from 2019, forgot to post ¯\(''/)/¯).
  • some polish still needed, so still w.i.p.

older version:


Cart #54769 | 2018-08-06 | Code ▽ | Embed ▽ | No License
2

P#54129 2018-07-12 18:38 ( Edited 2020-10-30 16:53)

SHOW MORE

Fixes:

Features:

  • pixel-perfect auto-resizing (optional, set autoresize to true in html)
  • minor enhancements (pico8 palette colors, black frame with shadow)
  • play button when autoplay is denied (in compliance with autoplay policy changes in chrome 66)

Tested on:

  • win10 (chrome,opera,firefox, edge(blurry as expected, lol@ms))
  • linux mint (chromium,firefox)
  • macos (safari)
  • itch.io, site & app (min embed size is 516x540, close fit with borders without autoresize)

How to:
unzip ub.html to {application data}/pico-8/plates
and then
> EXPORT FOO.HTML -P UB

minified version:
> EXPORT FOO.HTML -P UBM

Download:
https://www.lexaloffle.com/bbs/files/13845/ub_html_12.zip

Have fun!

(edit) no mobile support for now

...
1.2: power button when autoplay disabled (chrome update may 2018)
1.1c: fixed cursor keys scrolling page within iframe
1.1b: removed CRs, added minified
1.1: fixed select/drag/context menu
1.0: first version

Previous versions:
https://www.lexaloffle.com/bbs/files/13845/ub_html_11c.zip
https://www.lexaloffle.com/bbs/files/13845/ub_html_11b.zip
https://www.lexaloffle.com/bbs/files/13845/ub_html_10.zip

(free to use and modify, no attribution required)

P#50793 2018-03-25 09:21 ( Edited 2018-05-06 22:39)

SHOW MORE

It seems I'm using these a lot, so here they are:

-----------------
-- table as string
-----------------

function tab2str(t)
    local s="("
    for i,v in pairs(t) do
        if type(i)=="number" then
            s=s.."["..i.."]="
        else
            s=s..i..'='
        end
        if type(v)=="boolean" then 
            s=s..(v and "true" or "false")
        elseif type(v)=="table" then
            s=s..tab2str(v)
        else
            s=s..v
        end
        s=s..','
    end
    s=sub(s,1,#s-1)--remove last comma
    return s..')'
end

----------
-- example
----------

l={1,2,4,5,s=5}
print(tab2str(l))
----------------
-- clone a table
----------------

function clone(t)
    local c={}
    for i,v in pairs(t) do
        c[i]=type(v)=="table" and clone(v) or v
    end
    return c
end
---------------------------------------------------
-- sort a table (insertion sort)
-- cmp(a,b) should return true when a,b are ordered
---------------------------------------------------

function insort(t,cmp)
    for n=2,#t do
        local i=n
        while i>1 and not cmp(t[i-1],t[i]) do
            t[i],t[i-1]=t[i-1],t[i]
            i-=1
        end
    end
end

----------
-- example
----------

function ascending_y(a,b) 
    return a.y<=b.y 
end

t={}
for i=1,5 do 
    add(t,{i=i,y=rnd(10)}) 
    print(i..': '..t[i].i..' '..t[i].y)
end
print("----")
insort(t,ascending_y)
for i=1,#t do 
    print(i..': '..t[i].i..' '..t[i].y)
end
-- note: better version by kittenm4ster, read below
------------------
-- shuffle a table
------------------

function shuffle(t)
    for n=1,#t*2 do -- #t*2 times seems enough
        local a,b=flr(1+rnd(#t)),flr(1+rnd(#t))
        t[a],t[b]=t[b],t[a]
    end
    return t
end

----------
-- example
----------

t={1,2,3,4}
for i=1,#t do 
    print(i..': '..t[i])
end
print("----")
shuffle(t)
for i=1,#t do 
    print(i..': '..t[i])
end
------------------------------
-- random element from a table
------------------------------

function trand(t) return t[flr(1+rnd(#t))] end

----------
-- example
----------

l={1,2,3,4}
print(trand(l))
-- note: a little overkill token-wise, read below (thanks felice!)
-----------------------------------
-- stack (lifo: last in, first out)
-----------------------------------

lifo={
    new = function() return setmetatable({d={}},lifo) end,
    clear = function(m) m.d={} end,
    len = function(m) return #m.d end,
    empty = function(m) return #m.d==0 end,
    push = function(m,v) m.d[#m.d+1]=v end,
    pop = function(m)
        local v=m.d[#m.d]
        m.d[#m.d]=nil
        return v
    end
} lifo.__index=lifo

----------
-- example
----------

stack = lifo.new()
stack:push(10)
stack:push(20)
stack:push(30)
while(not stack:empty()) do
    print(stack:pop())
end

I think some of these would be handy as part of the pico8 api (clone,sort,shuffle...)

feel free to criticize, comment, correct mine, post yours...

P#49081 2018-02-08 08:32 ( Edited 2018-02-09 01:53)

P#47722 2017-12-28 05:19 ( Edited 2017-12-28 11:08)

SHOW MORE

Cart #47241 | 2017-12-10 | Code ▽ | Embed ▽ | No License

Well, it's that time of the year again!
(Last year's tree, this time with music thanks to gamax32's midi2pico)

P#47478 2017-12-17 14:38 ( Edited 2018-07-13 15:00)

SHOW MORE

Cart #51581 | 2018-04-13 | Code ▽ | Embed ▽ | No License
6

Did you know you're literally sitting on a vast supply of natural gas?
Thanks to Fracture, Inc. this cornucopia is now within your reach!
It's easy as 1,2,3:

  1. Install a rig from Fracture, Inc. in your garden, your field, your backyard!
  2. Buy the finest fracking chemicals from Fracture, Inc. (only $1 per barrel!)
  3. Start fracking!
  4. ...PROFIT!

So what are you waiting for? Order your personal fracking rig from Fracture, Inc. right now!

In no circumstances shall Fracture, Inc. be liable for any direct damage, indirect damage, incidental damage, consequential damage, or any other damage occurring to, including but not restricted to, family members, pets, cattle, neighboring fauna and flora with pre-existing conditions such as, including but not restricted to, being alive.

...

somewhat extented version: https://spacetruckergames.itch.io/fracture

...


v1.2:

  • went other directions ;)

v1.1:

Cart #49021 | 2018-02-05 | Code ▽ | Embed ▽ | No License
6

  • digging mechanic
  • down button: soft drop with soft lock
  • up button: hard drop with hard lock

v1.0:

Cart #47627 | 2017-12-22 | Code ▽ | Embed ▽ | No License
6

Work in progress!
note:
I made the game quite forgiving, and I just realized it's still playable without even cycling the colors.
maybe I could ditch the cycling altogether? or make it a difficulty option? what do you think?

P#47303 2017-12-11 20:34 ( Edited 2018-04-13 18:25)

SHOW MORE

Here's a simple one:

Cart #45944 | 2017-11-06 | Code ▽ | Embed ▽ | No License
13

use stat(x), where x is:

80..85  UTC time: year, month, day, hour, minute, second
90..95  Local time

Go crazy, guys!

P#45923 2017-11-06 09:42 ( Edited 2018-10-12 20:49)

SHOW MORE

Cart #45594 | 2017-10-29 | Code ▽ | Embed ▽ | No License
5

For some reason the Gates of Hell are wide open in a cemetary nearby! Send the demons back to where they belong by spelling out loud their true name!

A Halloween Guess'Em Up, using Zep's 7500 words dictionary

...

This game should have been released a year ago! I exhumed it this year, hoping I could polish it for good. but it seems I'm falling short once again! I'm not putting it back six feet under though, so here it is, in its (appropriate) semi-zombified state, in time for Halloween!

so, still a work in progress, but fully playable though. mostly the sound effects need some work...

Happy Halloween!

P#45595 2017-10-29 13:24 ( Edited 2017-10-30 00:09)

SHOW MORE

There's quite a bunch of pico-8 games on arcadeprehacks. they're leeched from here, and modified with "trainer" options. ads all around, no acknowledgment nor links to the original stuff. at least they could add a cracktro!

found the site searching for my "pellet muncher" on google. I lol'd at first. sad thing is, there's 1300+ "plays" there, while I painfully got a hundred "views" on itchio plus gamejolt. well, at least there are people playing my game...

P#45045 2017-10-10 07:29 ( Edited 2018-03-01 23:38)

SHOW MORE

Cart #45235 | 2017-10-15 | Code ▽ | Embed ▽ | No License
9

here's a wip of another take on my tetramino-making mechanic (T-Factory 1)
hopefully a little more appealing / a little less awkward (?)

P#44614 2017-09-25 21:12 ( Edited 2017-10-17 09:58)

View Older Posts
Follow Lexaloffle:          
Generated 2024-03-19 11:30:37 | 0.125s | Q:73