Log In  
Follow
aced
:: Unfold ::

An impostor among them... ๐Ÿง

?"แถœ2โถrw¹ใ‚ตโถ.แต‰³แถ \nใƒŠ0ใƒฆใโถ.แต‰ใ€Œใ‚›\nใƒŠ0ใƒฆใ¹ใ‚“โถ.แต‰³แถ \nใƒŠ0ใƒฆใ"

... What's the fewest tokens for a 'game'...?

P#120822 2022-11-17 01:17 ( Edited 2022-11-17 01:17)

:: Unfold ::

A new instance of PICO-8, will have the custom font properties set to zero.

?peek(0x5600) -- =0
?peek(0x5601) -- =0
?peek(0x5602) -- =0

This sets width and height to a default of 0 pixels. This will never be a useful default state.
It can be confusing for newcomers- and frankly is easily forgotten / overlooked for experienced users- when working with custom fonts.

Request:

  • Initialise custom font properties to a reasonable default of 8 x 8 px, which matches the one-off character default. i.e. poke(0x5600,8,8,8)
P#119148 2022-10-15 13:18 ( Edited 2022-10-15 13:19)

:: Unfold ::

Possibly a bug or just a quality of life issue...
Functions should handle trailing commas gracefully.

data={1,2,3,} -- trailing comma
poke( 0x5600, unpack(data) ) -- works
poke( 0x5600, 1,2,3, ) -- fails

... this may be fundamental to Lua?

P#119072 2022-10-13 22:23

:: Unfold ::

Hi,

I'm working on a collection of 'retro' 8x8 repeating patterns.
Since the fillp() function only supports 4x4 px patterns, the nearest data format is using Custom Fonts (1bit per pixel, 8x8px).

I'm planning on something like this:

?"\^!5600โธxโธ\0\0"

-- 97 'a' stonewall
poke(0x5600+(8* 97),
  14, -- โ–’โ–ˆโ–ˆโ–ˆโ–’โ–’โ–’โ–’
 230, -- โ–’โ–ˆโ–ˆโ–’โ–’โ–ˆโ–ˆโ–ˆ
 240, -- โ–’โ–’โ–’โ–’โ–ˆโ–ˆโ–ˆโ–ˆ
 102, -- โ–’โ–ˆโ–ˆโ–’โ–’โ–ˆโ–ˆโ–’
  15, -- โ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–’โ–’โ–’
  95, -- โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–ˆโ–’
 206, -- โ–’โ–ˆโ–ˆโ–ˆโ–’โ–’โ–ˆโ–ˆ
 224  -- โ–’โ–’โ–’โ–’โ–’โ–ˆโ–ˆโ–ˆ
)

-- 98 'b' picket
poke(0x5600+(8* 98),
   0, -- โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’
  34, -- โ–’โ–ˆโ–’โ–’โ–’โ–ˆโ–’โ–’
 102, -- โ–’โ–ˆโ–ˆโ–’โ–’โ–ˆโ–ˆโ–’
 255, -- โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
 102, -- โ–’โ–ˆโ–ˆโ–’โ–’โ–ˆโ–ˆโ–’
 102, -- โ–’โ–ˆโ–ˆโ–’โ–’โ–ˆโ–ˆโ–’
 255, -- โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
 102  -- โ–’โ–ˆโ–ˆโ–’โ–’โ–ˆโ–ˆโ–’

-- ...

)

and then to render the pattern,

print "\014aaabbb"
print "\014aaabbb"
-- etc.

Request for feedback:
(esp. @Heracleum, @dw817) ~ Is this reasonable?
Is there a more appropriate data type / graphics method?

Many thanks,
Andrew

P#118960 2022-10-12 17:43

:: Unfold ::

Hi,

Playing with custom fonts, I found that the \n escape sequence cannot be followed by an a in the string (probably an issue also with 0-9 and a-f). This doesn't occur in the default font mode (works as expected)...

poke(0x5600,8,8,8,0,0) -- setup 8x8 font

-- Char 97 'a'
poke(0x5600+(8* 97),
  12,108,99,3,48,54,198,192)

-- Works with "\n a"
?"\014 a\n a"

-- Missing character with "\na"
?"\014 a\na"

Possible bug: \na shouldn't be treated as an escape code for custom fonts (just \n).

P#116974 2022-09-06 16:40

Follow Lexaloffle:          
Generated 2023-03-28 20:51:33 | 0.080s | Q:14