Log In  
Follow
alexr
SHOW MORE

It took me a while -- as in, time spent inspecting code and debugging app -- to realize that cls(a) ignores prior pal(a,b) calls, hence filling the screen with a.

Assuming this is not a bug, it would be good to mention this in the docs for that function.

Cheers.

P#141732 2024-02-21 13:48 ( Edited 2024-02-21 13:52)

SHOW MORE

Is there a way to determine rendered text height, knowing that said text may contain the tall rendering mode option ? I could search for the presence of "\^t" if I can find a way to express the escaped version of that.

-- always prints 6
local text = "\^thello"
local h = 6
if sub(text,1,3) == "\^t" then h = 12 end
print(h)
P#141328 2024-02-09 14:29

SHOW MORE

Is there a way to, at runtime, trigger a reload of the game (changed code, possibly with #include s, and all) ?

Reason : I'm coding in an external editor and want to eliminate the edit-save-switch-run-switch loop by periodically, say within _update, trigger said reload+run.

Thanks

P#140982 2024-02-01 13:39 ( Edited 2024-02-02 13:54)

SHOW MORE

I am getting different results when invoking code in the console as opposed to calling it from inside a running program. The code overrides the default behaviour of the cos function.

pi=3.14159
two_pi=pi*2

-- override cos to work with radians
p8cos = cos
function cos(rad) return p8cos(rad/two_pi) end

-- degrees to radians
function d2r(d) return d*two_pi/360 end

-- this test works (cos(45 deg) => 0.7071)
function _draw()
 cls()
 print(cos(d2r(45)))
end

I then run the code, observing correct results (0.7071).

Invoking this from the console however: print(cos(d2r(45))) prints different results (0.2206).

Are function overrides ignored in the console?

P#111239 2022-05-03 13:35

SHOW MORE

I'd like to learn from some of the carts here in this forum by loading them into Designer. Is that possible?

P#88579 2021-03-05 13:54 ( Edited 2021-03-06 00:56)

SHOW MORE

What are the actual steps one must follow to begin scripting in Voxatron?

EDIT
It was right in the API docs

EXAMPLE (global script)

  1. create a script object, add it to the room, and edit it.
    old_draw = _draw
    function _draw()
    clv()
    old_draw()
    local dz = sin(time())*5
    sphere(64,64,32+dz,8,7)
    end
P#88282 2021-02-28 02:59 ( Edited 2021-03-01 00:28)

SHOW MORE

Is it possible to configure the camera such that it follows the player in a game?

EDIT
via a script placed inside the player folder (will add code once I've got that worked out)

P#88281 2021-02-28 02:56 ( Edited 2021-03-01 00:28)

SHOW MORE

Is there a way to evaluate a function call stored as a string, say "cls(2)"? I tried

eval("cls(2)")

but nope; no such beast.

P#86427 2021-01-13 16:34

SHOW MORE

How does one create a door, then link 2 instances of it across rooms? I've read the docs but an overview of what makes a door is not enough. Step-by-step, up to date instructions would really help. <nudge> @zep. :)

P#76494 2020-05-13 12:16 ( Edited 2020-05-13 12:17)

SHOW MORE

Cart #the_getaway_wip_1_2-3 | 2021-03-09 | Code ▽ | Embed ▽ | No License
6

You owe money to the wrong people and you only have a few minutes to pay it back. Grab the money bags and drop them at the safe house. Don't get caught. Don't run out of fuel.

Inspired by Getaway!, a crime-themed game designed by Mark Reid and published for Atari 8-bit computers in 1982.

Screenshots

Controls

  • up/down/left/right: drive/steer
  • x : speed boost

Changelog

1.3

  • minor UI and help text adjustments.

1.2

  • easy level debt reduced to $2000, with a due date of 2 minutes.
  • money bags sometimes appear closer to your location
P#74275 2020-03-28 15:34 ( Edited 2021-03-09 10:45)

SHOW MORE

I have a controller connected to my laptop. To configure pico-8 for it, I did : launch Gamepad Tool > Copy Mapping String > append string to sdl_controllers.txt > relaunch pico-8. This works well.

Now, I would like to use the controller's shoulder buttons as replacements for the d-pad's dpleft (btn 0) and dpright (btn 1), respectively. Can this be done at all? Note that this is not for exported (to html) games but rather to those launched from the pico-8 console.

EDIT:
To be clear, I'd like to control a pico-8 game using a gamepad's shoulder buttons.

EDIT2:
GamepadTool mapping string, as entered in sdl_controllers.txt is this:
03000000bd12000015d0000000010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,

P#71408 2019-12-26 02:50 ( Edited 2019-12-26 03:43)

SHOW MORE

Here's my 558-char TweetTweetJam3 entry, including memory poked sfx (thanks to @eruonna for documenting that).

Cart #jammerboard-1 | 2019-11-17 | Code ▽ | Embed ▽ | No License

P#69964 2019-11-17 11:40 ( Edited 2019-11-17 23:58)

SHOW MORE

How do I create a middle c note in sfx 0 programmatically? I'm not sure on the formula to calculate the offset from 0x6000.

P#69938 2019-11-16 14:03 ( Edited 2019-11-16 14:04)

SHOW MORE

I want to control my pico game via html element event handlers. Given that, what memory address (pico8_gpio offset) must I poke at if I want to simulate a btn(0) event? Also, what's the offset for simulating additional player actions, say, btn(0,1)? Thanks.

P#46446 2017-11-18 10:25 ( Edited 2017-11-19 00:21)

SHOW MORE

Is there a shortcut for editor code tab switching? Couldn't find it in the docs.

P#45762 2017-11-01 05:44 ( Edited 2017-11-01 20:34)

SHOW MORE

(This may sound convoluted)

Is it possible to invoke an embedded ("export html") pico-8 program's functions from an external javascript file?

In this particular case, I wrote a .js app that fetches remote data asynchronously (via ajax). I then want to map that data to a sequence of pico-8 program function names, invoking each one in turn at regular intervals.

P#32515 2016-11-15 13:51 ( Edited 2016-11-16 18:49)

SHOW MORE

I often browse the pico-8 forums on my mobile. On my phone (Samsung S4), I have to squint like a maniac because the contents of the pages are not rescaled by the browser, which they would be if the following viewport meta was on each page:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />

Can the person responsible for these forums (and web site in general) add that so that I can go back to "squintless" reading. :)

Cheers
Alex

P#25567 2016-07-19 15:19 ( Edited 2016-07-20 02:30)

SHOW MORE

Hi all.
The following code doesn't work -- players don't get drawn.
What am I doing wrong?
Thanks in advance.
Alex

players = {}

function make_player(col)
  local p = {}
  p.x = 0
  p.y = 0
  p.color = col
  return p
end

function draw_player(p)
  rectfill(p.x-2,p.y-2,p.x+2,p.y+2,p.color)
end

function _init()
  players.home = make_player(1)
  players.visitor = make_player(8)
end

function _draw()
  cls()
  foreach(players, function(p) draw_player(p))
end
P#14559 2015-09-24 10:12 ( Edited 2015-09-25 01:57)

SHOW MORE

Could someone explain how glitch effects similar to Benjamin Soulé's Mr.Beam were done? No code as much as an overview.

Thanks in advance.
Alex

P#13533 2015-09-01 22:44 ( Edited 2015-09-02 04:55)

Follow Lexaloffle:          
Generated 2024-03-19 04:08:36 | 0.079s | Q:36