Log In  
Follow
kozm0naut
SHOW MORE

This is pretty simple but I thought some devs might find it useful as an easy way to add a minimap to your game. It uses tline to draw a miniature version of the full map area to screen (during your _draw loop):

for i=0,64 do tline(0,32+i,128,32+i,4/8,4/8+i,1) end

The representative pixel is drawn from the center (4/8,4/8) of each sprite, but you can alter this if you want a different selection.

Here's an example of what this looks like in Celeste:

And here's Air Delivery with this line added:

Obviously it can be a bit messy raw, but it's accurate. For your own project, you could put this against a solid background color in your pause menu, for example. And then you might add an indicator for player position ;)

I hope this can be useful out there!

P#142332 2024-03-02 19:38 ( Edited 2024-03-03 02:41)

SHOW MORE

Shimmerscale

NOW IN GLORIOUS QUADRACOLOR

Consuming 239 chars because I didn't bother to minify further:

cls(13)s=sin
a=12b=4
::_::
t=time()/4
for i=0,36 do 
for j=0,42 do
r=(i+1.4*j)/64
m=12*s(t+r)
x=-8+4*i+3.4*s(t+r-.25)
y=-20+4*j+8*s(r)
if(btn(❎))a=11b=5
if(btn(πŸ…ΎοΈ))a=12b=4
o=a+(i/3+j/3+t*16)%b
line(x,y-m,x+1,y-m+s(t+r+.75),o)
end
end
goto _

Press ❎ to activate CHROMATOSIS:
An experimental bleeding-edge 5-color mode

Feel free to use/modify this effect for your projects!

a is the starting color and b is how many subsequent colors in the palette to use, so you can alter this to use any colors you want using pal({}) and those two variables. Note that the effect relies on not using cls() so this would be best suited to a splash screen or menu, or for use with clip()

*angle also slightly modified for this example

P#140449 2024-01-22 19:12 ( Edited 2024-01-22 21:28)

SHOW MORE

I've been working on a little tweetcart so that I might have something to actually release while still at work on more ambitious projects.

I was able to get it down to 272 chars. It runs at 60fps.

Edit: Used up the last few characters fixing a bug, refining the decay and adding some slight interactivity. Some chars can probably be reclaimed by combining the loops somehow (and using goto instead) but I'll probably just leave it at this.

It starts slow and continues building over time. Enjoy!

Cart #tc_firedance-2 | 2024-01-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

P#139821 2024-01-08 16:39 ( Edited 2024-01-31 19:21)

SHOW MORE

Hi, I apologize that this is in the PICO-8 bugs category, but I don't see one for BBS bugs. For the last few days it would seem some (not all) @ mentions (e.g. @kozm0naut) have not turned to links as normal, and I'm not sure users are getting the usual notifications that they've been mentioned.

Here are some recent posts in which @ mentions did not seem to work for me despite having the correct username:
https://www.lexaloffle.com/bbs/?pid=139543#p
https://www.lexaloffle.com/bbs/?pid=139504#p

Thanks for reading, and happy new year!

P#139544 2024-01-02 17:55

SHOW MORE

Hello all, I'm still learning about PICO-8 and I'm interested in ensuring I understand the implications of using local variables, global variables or upvalues.

As many do, I use a for/in loop to update my roster of enemies:

 for en in all(ens) do
  local ecx,ecy,efov=en.x+2,en.y+3,0.1
  --apply friction
  en.dx*=(en.dx>0.05 or en.dx<-0.05) and fric or 0
  en.dy*=(en.dy>0.05 or en.dy<-0.05) and fric or 0

  if (en.alert>0) efov=0.3

  --sees player?
  if (sees(ecx,ecy,pcx,pcy,50,en.fac,efov,2)) then
   --face toward player
   en.fac=atan2(pcx-ecx,pcy-ecy)
   --set terminus
   en.tx,en.ty=pcx,pcy
   en.alert=2
  -- ...etc

My question is regarding the locality of the current element ("en" in the example above) and its constituent table elements. If I'm going to be reading en.x, en.dx, etc. multiple times within the loop, will it save cycles to make local copies of each of these first, or are they already local by being part of the current element ("en")?

Thanks!

P#138692 2023-12-14 18:54

SHOW MORE

In the PICO-8 sprite editor, copying and pasting a sprite will copy the sprite's contents and flags, but using undo from this point will reverse the pasting of the sprite content but not the flags, leaving the flags set.

Not a huge deal, but I thought I would point it out. Thanks!

P#137911 2023-11-26 20:21 ( Edited 2023-11-26 20:22)

Follow Lexaloffle:          
Generated 2024-03-03 15:42:07 | 0.092s | Q:17