Log In  
Follow
alexr

Pattern Playground lets you select and modify the fill patterns and colours of various shapes in a set, see the rendered results, choose a combination that you like, and output its values to the console.

It helped me get a better grip on patterns while working on some other yet to be released project.

Instructions

Selection / Editing Contexts

  • Set (as in, a grouping of shapes) selector
  • Object (as in, shape) selector
  • Current object (base) colour selector
  • Pattern editor
  • Pattern on-bits colour vs. transparency toggle
  • Pattern on-bits colour selector

Controls

  • U/D/L/R to navigate across and within contexts
  • [X] to toggle/select
  • [Z] to print current set object patterns and colours to console

Sets

Mixed

Prairie

Mars

[ Continue Reading.. ]

7
0 comments



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.

3 comments



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)
7 comments



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

1 comment



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?

7 comments



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

1
7 comments



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
0 comments



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)

1
4 comments



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.

1
7 comments



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. :)

1
4 comments



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.

[ Continue Reading.. ]

6
3 comments



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,

3 comments



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

11 comments



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.

2 comments



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.

2 comments



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

5 comments



(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.

3 comments



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

2 comments



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
6 comments



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

1
2 comments





Top    Load More Posts ->