Log In  
BBS > Lexaloffle Community Superblog
This is a combined feed of all Lexaloffle user blogs. For Lexaloffle-related news, see @zep's blog.

All | Following | PICO-8 | Voxatron | General | Off-site
[ :: Read More :: ]

Cart #dbuzifogi-0 | 2019-11-30 | Code ▽ | Embed ▽ | No License

Hello everyone! Another simple game I have made in 1 day. Still getting use to the system and hopefully I'll make more complex and interesting games as time goes on.

P#70412 2019-11-30 22:27
[ :: Read More :: ]

Cart #zkomijg-0 | 2019-11-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

A Discs Of Tron demake (in progress - this cart has been gathering dust for a while - since 2016 at least)

P#70410 2019-11-30 21:31 ( Edited 2019-11-30 21:31)
[ :: Read More :: ]

Cart #threecube-0 | 2019-11-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

It's the cube. You know the one.
Check the menus. There are options.

P#70408 2019-11-30 20:21 ( Edited 2019-11-30 20:21)
[ :: Read More :: ]

Cart #dotgobblerinsockjustice-1 | 2019-11-30 | Code ▽ | Embed ▽ | No License
6

Dot Gobbler, having escaped the confines of his maze, finds himself in the great outdoors for the first time. Blinking and uncertain in the light of a new day, he ventures forth into the wilderness in search of dots, and perhaps something to put on his feet.

Controls:
Left/Right Arrow: Run left or right.
Down: Crouch, or roll when running.
Z: Start game, Jump.
X: View instructions, Open/Close Sock menu.

Collect of the dots, while avoiding or attacking the Ghosts; Dot Gobbler's only attack is to roll into enemies. Red dots will restore health. Socks can be collected, and worn using Sock stations, increasing Dot Gobbler's abilities. This will allow him to reach new areas.

[0x0]

P#70402 2019-11-30 15:43 ( Edited 2019-11-30 21:22)
[ :: Read More :: ]

Hey, everyone! So I am NOT good at math. It's something that I usually figure out once through trial and error and try not to touch ever again. So I'm turning to the more mathematically capable among us to help me decide on something: should I use a new method of determining the distance between two x/y coordinates?

Here's what I've been using up to this point:

function dist(x,y,x2,y2)
 --gets the distance between
 --two points. faster than
 --the previous version.
 local dx, dy = x - x2, y - y2
 local res=(dx * dx + dy * dy)
 if res<0 then
  res=32767
 end
 return res
end

This is the best I could figure out, and I'm sure it can be improved. It overflows, despite my best efforts to prevent it, but it was passable as long as I worked within its limitations.

Here's what I'm thinking might work better:

function xdist(x,x2)
 --gets the distance between
 --two coordinates.
 return abs(x-x2)
end

In theory, this has no complicated math, and could be used to build another function with the same purpose as the original, even though this only works with two. But here's my question: is it faster? Is the math right?

I appreciate any advice and help given! This forum has been invaluable to me.

P#70392 2019-11-30 05:42 ( Edited 2019-11-30 05:43)
[ :: Read More :: ]

Cart #hackattack-0 | 2019-11-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

I recently created this game for TweetTweetJam3 in exactly 560 characters!

The objective of the game is to hack through as many layers of security as you can by matching the wave signals that are presented on screen before time runs out.

Press X to start, and use the up/down/left/right keys to adjust your wave (white) to match the green one. Plays quite nicely on a gamepad as well if you have one on hand. :)

The further you get, the more unstable the waves will become, making them more difficult to match!

Hope you enjoy :)

P#70387 2019-11-30 00:32
[ :: Read More :: ]

Hello! On the Carts category page https://www.lexaloffle.com/bbs/?cat=7&sub=2 , the three featured carts at the top are not real links (a elements), but divs with a custom JavaScript handler. This does not work with all the tools that know about links: ctrl+click to open in a new tab, middle click, long press on mobile, bookmark link, contextual menu, search links in page, etc. Please consider changing this!

P#70377 2019-11-29 19:17
[ :: Read More :: ]

Cart #flappy_pico-3 | 2019-12-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

Here's my Flappy Clone! 頑張って!

1.03 -- added sound and screen shake

P#70374 2019-11-29 18:25 ( Edited 2019-12-01 06:59)
[ :: Read More :: ]

Cart #xzero-3 | 2020-03-14 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
312

Hack all the terminals and defeat the boss.

This is my attempt at making a polished game in a week and a half, although it ended up being 2 weeks. I had to drop a few features I wanted to put in due to time, and code ended up getting a bit messy. Still, I'm pretty happy with how it came out.

The frame rate can drop sometimes, particularly in the later parts of the game when there are a lot of enemies around.

UPDATE
Removed a tiny amount of unused code and added as many comments as I could fit without going over compressed size.

UPDATE 2
Added the ability to swap jump and shoot buttons because the defaults felt awkward in gamepad. Also fixed a couple of minor audio bugs.

P#70362 2019-11-29 12:24 ( Edited 2020-03-14 01:19)
[ :: Read More :: ]

Hi!

I´m new to pico 8 and I do my first steps in moving an sprite through an dungeon.

that works well, but i the sprite moves on and on while keeping the button pressed

I want to stop after moving one tile in the pressed direction

so for moving on and on you have to press the button over and over again

How can I do this?

I tried it whith

repeat
until btn()==true
return

but it doesnt work

Thanks for help!!

P#70361 2019-11-29 11:17
[ :: Read More :: ]

I've got Pico-8 running nicely on my Raspberry Pi through Retropie/Emulation Station now, but there's one minor annoyance.

It's a bit of a faff to have to reach over to the keyboard to hit Ctrl-R to start a game or Windows+Q to exit back to ES. It'd be really handy to be able to map those commands to a couple of the spare buttons on my arcade stick.

I see there's a file called sdl_controllers.txt, containing the text // add SDL2 game controller mappings to this file, but that's ALL it says. There are no clues as to what it wants that file to contain in order to map anything. config.txt also includes these lines:

// Custom keyboard scancodes for buttons. player0 0..6, player1 0..5
button_keys 0 0 0 0 0 0 0 0 0 0 0 0 0

but again, heaven knows what that means. KEYCONFIG is no good, it only lets you redefine the two Pico controller action buttons, not the other ones on my arcade stick.

Can anyone help?

P#70346 2019-11-29 01:07 ( Edited 2019-11-29 02:09)
[ :: Read More :: ]

Almost beta baby

Cart #hupakawpe-0 | 2019-11-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#70326 2019-11-28 17:23
[ :: Read More :: ]

sst
by dw817
Cart #sst-0 | 2019-11-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3


TO LOAD THIS CART in Pico-8, type:

load #sst

Use the ARROW KEYS to navigate and the (O) key to flip back and forth between 2D stars and 3D stars.

Sphere Stars as I call them has always been something to elude me. While I spent literal months on and off years ago back in QBasic trying to reproduce the "bowl" effect, I was never entirely successful.

Thanks to @freds72 he showed me it is indeed possible to reproduce. And maybe that was the push I needed to try one more time using a method I knew would benefit me later.

What method is that you ask ?

I have remapped every single pixel on the screen to a circular bowl. So when you plot on the screen instead of a rectangle you are actually drawing in a bowl and you get that nice curved effect when you navigate around the 2D star array.

I first saw this animation on a NES cart called, "Star Voyager." I remember renting it at the time and being utterly fascinated with how the stars moved in it, even being late in returning it even though I had no idea how to play the game. :)

https://youtu.be/HyMBk9FfDCI?t=140

And now I have mastered it. So what's next ? Well since I finally have star movement code the way I want it I can start working on a good space-shooter game. I may even incorporate my HYPERSPACE effect as part of the game. :)

https://www.lexaloffle.com/bbs/?pid=69932

P#70319 2019-11-28 02:32 ( Edited 2019-11-28 02:46)
[ :: Read More :: ]

Cart #refifomope-0 | 2019-11-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

I don't know about anyone else, but I can never resist a proper Christmas game. So what better time to make a Christmas-themed pico-8 game?

In Last Christmas, you play Santa, desperately attempting to deliver presents during an apocalyptic meteor strike. Can you save Christmas and deliver presents to boys and girls before their homes are destroyed, or will you leave their final moments on Earth marred by disappointment, believing - as they face incineration - that they just didn't make the Nice List this year?

It's up to you. Don't let them down.

P#70314 2019-11-28 00:17 ( Edited 2019-11-28 00:19)
[ :: Read More :: ]

Cart #three_sokoban_levels-0 | 2019-11-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#70291 2019-11-27 15:41
[ :: Read More :: ]

Cart #versun_pan-1 | 2019-11-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

P#70282 2019-11-27 09:26 ( Edited 2019-11-27 09:38)
[ :: Read More :: ]

p8r
by dw817
Cart #p8r-4 | 2019-11-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

TO LOAD THIS GAME in immediate mode, type out:

load #p8r

It seems a shame to leave ZEP's own marvelous JELPI sprites behind on just his opening demo cart, so I borrowed them for my latest game, Pico-8 Roadway !

Based upon the Atari 2600 game called FREEWAY:

https://youtu.be/3ICFiRZ-xSA?t=6

To move the 1st player forward, press (O) or equivalent.

To move the 2nd player forward (if desired), press the 2nd player (O) key, usually TAB.

Uses my collision function:

https://www.lexaloffle.com/bbs/?tid=36034

Game saves CARTDATA high-score.

Note: if you have any suggestions or ideas on making improvements in this game, please let me know and chances are - it will happen. :)

P#70263 2019-11-27 01:25 ( Edited 2019-11-27 05:21)
[ :: Read More :: ]

ccm
by dw817
Cart #ccm-0 | 2019-11-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5


TO LOAD THIS CART in immediate mode type:

load #ccm

I have need of this function for a different game I'm working on - so you get a chance to enjoy and make use of it for your own projects.

Today most games in Pico-8 use what is called a HIT BOX to determine if there is a collision between two objects. And while it works fairly well it is not entirely accurate.

For instance, you could have a comparison between two completely different sprites and the hit box area would either be too big where a collision occurs even if they are not touching, or the hit box could be too small where you must run right up against the target and even though you are touching it, it does not register.

While this is good enough for most games, let's take a rare example of a game called VENTURE.

Venture was a challenging and interesting game in that the very pixels made it difficult to complete a level.

You would navigate WINKY your player around opponents and when you shot them while they did die, they also disappeared slowly one pixel at a time.

If the player were to touch any side of a live sprite or even a single dot of the dead one, comparing by pixels, that would defeat the player and they would have to start the level over.

And if you got yourself trapped in a narrow corridor waiting for an enemy's pixels to vanish enough so you could get around, this unstoppable skull comes after you - so it was the player's mission to grab the treasures from each room and leave as quickly as possible, trying not to shoot the opponents especially if they were blocking a door or exit.

Please enjoy this fairly complex function I wrote to do true pixel collisions.

To my knowledge no such routine exists for Pico-8 nor has anyone written one so it is indeed useful for pixel-accurate sprite collisions.

Two sprites are compared in the quickest way possible by determining both size and shape, including for instance a check between 15x4 and 20x18 if you so desire. Every pixel is checked and it does it the quickest way possible as well by determining which sprite is the smallest and largest.

The function itself uses several arguments:

-- sh1=spritesheet source x
-- sv1=spritesheet source y
-- sx1=spritesheet size x
-- sy1=spritesheet size y
-- ph1=screen position x
-- pv1=screen position y
-- sh2=spritesheet source x
-- sv2=spritesheet source y
-- sx2=spritesheet size x
-- sy2=spritesheet size y
-- ph2=screen position x
-- pv2=screen position y

In this demo code above, try going to the sprite sheet and changing the shapes of the sprites to see the collisions truly are being checked per pixel.

HOPE THIS HELPS !

P#70253 2019-11-26 18:31 ( Edited 2019-11-26 23:29)
[ :: Read More :: ]

Does anyone actually have this working? If so, can you just tell us in simple language what we need and where? This much-linked "tutorial" is completely incomprehensible to normal people https://www.lexaloffle.com/bbs/?tid=3935 and none of the others I've found are any better.

Here's where I'm at so far:

I've copied the pico-8 folder you get into /home/pi, since after much searching I eventually figured out that's where it was meant to go.
I've got a file in that /home/pi/pico-8 folder called +Start PICO-8.sh, whose contents are this:

#!/bin/bash
pushd "/home/pi/pico-8"
./pico8 -splore
popd

I have absolutely no idea what any of that means, I just copied and pasted it from some of the various gibberish tutorials.

I've added the following to es_systems.cfg:

  <system>
    <name>pico8</name>
    <fullname>PICO-8</fullname>
    <path>/home/pi/pico-8</path>
    <extension>.sh .p8 .p8.png .SH .P8 .P8.PNG</extension>
    <command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 "/home/pi/pico-8/pico8 -splore"</command>
    <platform>pico8</platform>
    <theme>pico8</theme>
  </system>

I've added a couple of game files (in .p8.png format) into the same folder, because I couldn't see anything telling the Pi to look anywhere else for them. (Though I put them in /home/pi/RetroPie/roms/pico8 as well just for laffs.)

And I added a theme in /opt/retropie/configs/all/emulationstation/themes/carbon/pico8, and an EMULATORS.CFG in /opt/retropie/configs/pico8, even though nobody mentioned doing one, just because that's what you do for every other emulator in Retropie and in case it helped somehow. Contents of the file:

pico-8 = "/home/pi/pico-8/pico8 %ROM%"
default="pico-8"

Now when I boot EmulationStation the Pico-8 core shows up, but the only file listed is +Start PICO-8.sh. When I try to run it I get dumped back to the menu, with this RUNCOMMAND.LOG:

Parameters: 
Executing: /home/pi/pico-8/pico8 /home/pi/pico-8/+Start\ PICO-8.sh
/opt/retropie/supplementary/runcommand/runcommand.sh: line 1002: /home/pi/pico-8/pico8: Permission denied

The permission settings for the pico-8 folder are 0755. One of the tutorials said something about "a+x" but I haven't a clue what that means, so I just checked all the X columns. When that didn't work I tried the blunt instrument of making it 0777 but it made no difference.

Then I tried changing the permissions on the pico8 executable file itself to 0777, and got this RUNCOMMAND.LOG instead:

Parameters: 
Executing: /home/pi/pico-8/pico8 /home/pi/pico-8/+Start\ PICO-8.sh
/home/pi/pico-8/pico8: error while loading shared libraries: libwiringPi.so: cannot open shared object file: No such file or directory

I searched for that and eventually found out that I should be trying to install something called wiringpi, but when I tried that I got this:

And I'm wary of typing the suggested command because I haven't a clue what it might do.

All I want to do is run it like a normal ES core, with a list of "ROMs" (the .p8.png files) that run when I click them. Any useful thoughts gratefully received.

P#70240 2019-11-26 02:44
[ :: Read More :: ]

cs
by dw817
Cart #cs-0 | 2019-11-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

TO LOAD THIS CART in immediate mode type:

load #cs

Use the arrow keys to navigate between the 8-images stored. Press (O) to turn on and off the status.

  1. Santa Claus
  2. Rudolph
  3. Christmas Tree
  4. Jingle Bells
  5. Snowman
  6. Candy Canes
  7. Christmas Wreath (turned out nicely !)
  8. Gingerbread Man

Thought I would start a fresh tab for this new code. And there's quite a bit new about it.

While before you could guarantee a compression of 682-chars per picture, now it is based upon the cluster of pixels. So more black or white space means greater compression.

Also it no longer uses the Spritesheet even for temporary storage, it's all self-contained now.

Here is a slideshow using standard _init(), _update(), and _draw() to demonstrate it with the smallest picture being 438-chars and the largest being 592-chars.

And - I think this is as far as I can go in my coding with this particular method of picture compression. It was an interesting run, 2-weeks was it ? And I'm off to work on other things now.

P#70218 2019-11-25 18:31 ( Edited 2019-11-25 19:06)
View Older Posts