Log In  

BBS > Superblog
Posts: All | Following    GIFs: All | Postcarts    Off-site: Accounts

Cart #sesatereke-0 | 2021-10-13 | Code ▽ | Embed ▽ | No License
1

Someone on Twitter asked for this, and this seemed like the easiest place to share the code.

function preplace_in_circle(centerx,centery,radius,checkcol,newcol)
	local topleft={x=centerx-radius,y=centery-radius}
	local bottomright={x=centerx+radius,y=centery+radius}
	for x=topleft["x"],bottomright["x"] do
		for y=topleft["y"],bottomright["y"] do
			if (x-centerx)^2+(y-centery)^2<radius^2 then
				if (pget(x,y)==checkcol) pset(x,y,newcol)
end
end
end
end
function psetin_circle(centerx,centery,radius,checkcol,col)
	local topleft={x=centerx-radius,y=centery-radius}

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=98594#p)
1
1 comment


I'm tying to build GOL on PICO-8, but the per-pixel manipulation is just too slow. Anything more than about 48x48 is unacceptably slow.
Initially I was reading/writing into temporary tables but that was really slow. This approach keeps all the state on the screen and in a sprite so there's about a quarter of the work from the table approach, but it's still slow.

I've started another experiment with peek4/poke4 but the coordinate wrapping is a total pain.

Cart #the_slow_life-0 | 2021-10-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

1 comment


DOOMY (overdue Pico-1k jam)

by p01
Cart #doomy-1 | 2021-10-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
24

DOOMY, a tiny first person shooter in 1024 bytes, with collision detection, arbitrary walls, texture w. fog, sound effects, a couple of baddies and a death screen 👹👺💥

Controls & Goal

Move around with the Left, Right and Up arrow keys. Shoot with X or C.
You start with 10 health points, and need to shoot as many baddies until they get you good!

Inspiration

Seeing great and cute entries closing Pico-1k jam was inspiring. That's when I got an idea: "all things SSPR" to balance this cuteness with DOOMY pointless violence and big pixels.

Technical details

In a nutshell DOOMY is a rotozoom (the effect you get when rotating and zooming an image) laid down flat and rendered with scaled sprites.

Setup

The textures, sprites, and the base of the level are rendered as a group of rectfill and text in the first 3 lines of code, with first two textures of 8x8 for the walls, then 2 baddies, and finally the base of the level.

In the following 4 lines, the base of the level is expanded and some diagonal walls are added.

Every "thing" in DOOMY goes in the ▥ object which contains the x,y,t,w properties for the x,y position of the thing, it's texture index t and width w (nil or 1 for walls, 8 for the baddies)

Game loop

In the game loop the things in ▥ are rotated and moved into another object, 🐱, if they are in the visibility fustrum. The baddies move erratically towards the player.

The things in 🐱 are then sorted and rendered back to front, if one of these thing is large, it means it's a baddy and we render a shadow with an ovalfill

Collisions and baddies hit

For the collision detection, we check the distance of the last thing we drew. Blocking the way forward if it's very close.

We check the color of the pixel under the crosshair to know if it's a baddy. If you shoot we play a noise, increase the score and respawn it at a random location. Otherwise there is a 10% chance it will shoot you with a red flash and some noise.

You know the baddies are bad because they keep shooting you even when you're down!

Source code

u=.2v=1.5a=0p=0h=10▥={}r=rectfill f=add
cls()r(0,0,15,7,13)f(▥,{x=3,y=4,t=24,w=8})?"#%$3ᶜ9웃ᶜ8]

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=98580#p)
24
8 comments


Hello,

I have a problem with some code in version 0.2.3 that worked up to the previous version:

  if stat(30)  then
      local k = ord(stat(31))
  end

ord(stat(31)) always returns null but was returning the correct value before.

It works if changed to:

  if stat(30)  then
      local k = stat(31) k=ord(k)
  end

The RoboZ

1
1 comment


Hello,

while trying to compact code to save tokens I ran into an issue when trying to use split with strings containing escaped numbers \0, \1, etc.. (to store binary data that will be converted with ord()

s="abc\0def ghijkl"
split(s," ")

This seems to stop at \0 and the string part after " " will not be in the resulting table.

Is this intended behavior or a bug? With other escaped characters as \n \r \t the splitting works fine.

If this could be possible it would help me save additional tokens.

Thank you,

TheRoboZ

1
4 comments


I get screen tearing in any scrolling Pico 8 game that I tried, even when navigating the splore menu. A retro console shouldn't have screen tearing.

Is there any way to enable VSYNC and get rid of screen tearing in Pico 8?

If this is not possible currently, can Vsync be added in the future?

6 comments


Creating this blog to house my tweetcarts.
The first is this fireball creation ☄️

  • pset instead of CLS
  • pset is used to check pixel colour and change the colour to one lower in the COL table.
  • two circles spinning around which get small as the radius from the centre gets smaller.

Cart #fireballrebirth-0 | 2021-10-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

1
1 comment


Ever wish PICO-8 had dual analog stick support? Me too, so I wrote Pinput. Pinput is a Lua library and suite of external helper apps to provide XInput-like gamepad support to PICO-8, without requiring binary patching. The library and helpers use the GPIO area of cartridge RAM to communicate, making Pinput a sort of virtual peripheral plugged into an imaginary expansion port. (The P8T Twitter client uses GPIO the same way.)

You can try it now if you have a gamepad that works with your browser. (You may want to test it first with this gamepad test page.)

Demo video:

Pinput working in web browser with Logitech F310 gamepad

What do you get?

  • Up to 8 players

[ Continue Reading.. ]

11
9 comments


Cart #grave_matters-1 | 2021-10-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

My first attempt at a PICO-8 game.
I've never tried anything like this before, so it's been a fun learning experience.

This is my spooky side scroller hopefully wrapped up by Halloween.

Update 4)

  • Adding a fade on death as well as some basic palette twiddling to make it look a little nicer.
  • More music because I'm kind of tired of hearing it at this point.
  • Spikes and death! Although the collision detection is going to need some major overhaul.

Update 5)

  • More interactions
  • Starting enemies
  • More music
  • More map

Update 6)

  • Bats! Spiders! Spikes!
  • Death!
  • Pixel collision!
  • If you can get the "potion", you've "won" for now!

Update 7)

  • Health!
  • End-game and win condition
  • Spooky Scary Music!

Update 8)

  • Add Easy Mode
  • Calling this one ready for Halloween

Here's the "Release Post" https://www.lexaloffle.com/bbs/?tid=45134

8
12 comments


Hello all I've had some PICO-8 palettes lying around for Aseprite for a while so I decided to create a gitlab repo and let others use them. I know Aseprite comes with PICO-8, but I created a more complete set based off a palette image i found.

The repo is at https://gitlab.com/pico-8/aseprite

If you don't want to go to the repo the extension file is:
parlortricks-pico-8-palettes.aseprite-extension

Here is what it looks like if you follow the installation:

Hope this helps out someone :)

7
4 comments


Cart #wipzelda-0 | 2021-10-12 | Code ▽ | Embed ▽ | No License
1

1
0 comments


  • My own mandelbrot implementation
  • Half-finished
  • Working OK, but in a weird way
  • Nice color palette though
  • Arrows + z/x for zoom/dezoom

Cart #mepowatusu-0 | 2021-10-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

4
5 comments


Hello all.
Can any of you clever folk make this code shorter?
It's bugging the life out of me but I don't know how to make it shorter though it looks like it can be.
Cheers.

    --p.c= n / 2 + 0.5 ?
    if (p.t/p.die<7/#p.c_table) p.c=4
    if (p.t/p.die<5/#p.c_table) p.c=3
    if (p.t/p.die<3/#p.c_table) p.c=2
    if (p.t/p.die<1/#p.c_table) p.c=1
3 comments


Cart #lassehonnens_pwp_beta-8 | 2021-10-14 | Code ▽ | Embed ▽ | No License
5


The work is coming to an end. So is the world.
You awaken in a hospital infested with zombies.
Someone has left a pumpgun for you to try and make your way out alive.

Controls

Left and right: Move
Up and down: Enter and exit doors.
Z: Throw grenade
X: Shoot / melee attack when grabbed by a zombie.

5
3 comments


KATAMAR1K

An homage to KATAMARI DAMACY for Pico8 in 1021 bytes for the #PICO1k jam

Cart #katamar1k-0 | 2021-10-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
11

Story

The King of all Cosmos was naughty again. He broke all the stars and sent you, the 5cm Prince, to earth with a Katamari ball to collect things of increasing size to build up a star and fix his mess

Controls

Use the LEFT and RIGHT arrows to steer the little Prince

Watch out! Things will fall off your Katamari ball if your try to collect something that is too big

Goal

Collect enough things with your Katamari ball to reach 64cm as fast as possible to please the King of all Cosmos.

Post a screenshot of your time on Twitter with the #PICO1k hash tag. Who knows, the King of all Cosmos might like it.

[ Continue Reading.. ]

11
2 comments


Cart #boatbuoys-0 | 2021-10-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

Simple boat game where you try to make it through all of the buoys to gain more points. You only can mess up 3 times before you've got to call it quits. Really easy at the beginning, but gets near impossible as the buoys start to appear closer and closer together. Good luck!

4
0 comments


Hello again. I saw that someone was able to display Pico 8 on a CRT monitor, so I wanted to do the same. If you have any questions or want help getting Pico 8 to display on a CRT monitor, post down below and I can try to help. I was able to do this on a Pi Zero and a Pi 3b+. The hardest part of this project for me wasn't getting the display to work with my Pi 3b+, but USB audio not wanting to cooperate. I tried using the audio jack on my Pi, but it was interfering with the soldered wires I had. It all works now. This is officially my favorite way to play. Yes, playing on a handheld is cool and all, but Pico 8 looks amazing on a CRT.

13
3 comments


Hi there, fellow PICO-8 lovers. Today I want to share something I've been working on a little bit here and there throughout the year, and ask for a little feedback.

Cart #tojenanoja-0 | 2021-10-10 | Code ▽ | Embed ▽ | No License
1

My endgoal for this text box is to be able to make decisions (2- or 3- options at most) and to add extra features, such as Zelda-like highlighting, chaining to another textbox (for conversation), and a page-break like feature to pace which lines get scrolled in. So far, I have a custom inset and outset animation with sound, per-letter sfx, a throbbing button indicator to advance, and clean removal from the objlist.

It's taken me quite a bit of trial and error to pull this off. If you know of ways to simplify my code while supporting all of the same features, please let me know!

[ Continue Reading.. ]

1
0 comments


Cart #makhganu-0 | 2021-10-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

4
3 comments


Cart #yofutitede-0 | 2021-10-10 | Code ▽ | Embed ▽ | No License
3

Extremely unfinished atm but I'd love some feedback. Right now it's endless but I'd like to integrate some sort of ending, originally I wanted a really elaborate final boss but I don't think I can do that within the token limit. If anyone has any ideas, I'd love to hear them!

Instructions:

Z to use subweapons when you get them
X to attack with whip

arrows to move

Get upgrades to your hearts (ammo for subweapons), your maximum life and the power/length of your whip, and then get to the exit!

I realize most sound effects etc. aren't there, but they will be if I ever finish the game.

3
2 comments




Top    Load More Posts ->