Log In  
Follow
mhughson
SHOW MORE

Cart #abbyboat-0 | 2021-11-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

Made a new game with my daughter.

Pilot a Paddle Boat to the finish line.

Z - Left Paddle
X - Right Paddle

P#99762 2021-11-07 21:56

SHOW MORE

I've been playing Pico-8 on handhelds (no keyboard) a lot lately and I think there is a "gap" in that experience.

Once you have exhausted the "new" and "featured" sections, there isn't a good way to find new games to play.

I would love to have a "play random game" option in Splore! Given the FREE, quick, "pick up and play" nature of Pico-8 games, I think it would work quite well. Perhaps even "show me 20 random games", where I could quickly scroll through and see if any cover art catches my eye.

Thanks!

P#93982 2021-06-24 17:25 ( Edited 2021-06-24 17:26)

SHOW MORE

Cart #fabizuhese-0 | 2021-01-23 | Code ▽ | Embed ▽ | No License
2

P#86707 2021-01-23 05:59

SHOW MORE

Cart #gfx_import_example-0 | 2019-03-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
28

For my game, Witch n Wiz (https://www.lexaloffle.com/bbs/?pid=38117#p), I implemented as simple technique for loading a secondary spritesheet at runtime. This allowed me to have a fullscreen title graphic, but not use up any of the sprite sheet memory (needed for game sprites and map data).

The cart at the top of this post is an ultra simple example of it in use. As you can see, you are able to switch between 2 sprite sheets that would each normally take up the entire sprite memory.

Credit for the num2hex function goes to felice (https://www.lexaloffle.com/bbs/?tid=30910)

Limitations:

You can still only have 128x128 worth of sprites in memory at a time. So this is really best for things like the title screen, or major switches in gameplay (say switching worlds where you don't need any of the original sprites anymore).

The runtime code for this is very light in tokens (~100) but the additional sprite sheet is stored as a large (although compressed) string, so that is going to each into your character count and compressed size (around 8000 chars in a typical case, and 25% of the compressed cart limit).

Tutorial:

1) Export

The first thing you need to do, is export your second sprite sheet into a compressed string format the runtime code expects. To do this, you simply load up this cart in Pico-8:

Cart #gfx_export-0 | 2019-03-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
28

Fill the sprite sheet with the content you want to dynamically load at run-time, and hit "run".

This will copy the compressed data to your computers clipboard as a string. Paste that somewhere, like notepad.

2) Copy Runtime Code

Next, open up the import example (or view the code here in the broswer):

Cart #gfx_import_example-0 | 2019-03-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
28

There is a small section of code you will need to add to your cart. Everything between "gfx import runtime begin" and "gfx import runtime end".

This is the code here for reference, if you don't want to load up the cart:

--
--gfx import runtime begin.
--
--copy and paste this into your
--game cart.
--example usage after "end".
--

-- converts hex string
-- to actual number
function hex2num(str)
    return ("0x"..str)+0
end

--call this when you want to
--load your fullscreen 
--graphics.
--this assumes a compressed
--format of <count>..<color>..
function load_stored_gfx(gfx)
    index=0
    for i=1,#gfx,2 do
        count=hex2num(sub(gfx,i,i))
        col=hex2num(sub(gfx,i+1,i+1))
        for j=1,count do
        sset((index)%128,flr((index)/128),col)
        index+=1
        end
    end
end

--call this to go back to 
--the original graphics stored
--on the cart.
--eg.after displaying title
--screen.
function restore_gfx()
    reload(0x0,0x0,0x2000)
end

--
--gfx import runtime end.
--

3) Paste Export Data

Go an get that string that got exported in step 1, and paste it into your game cart as a variable somewhere.

--something like this.
--it will be very large, so I just truncated the string in my example here.
local my_gfx="f51d151d151d151d151"

4) Load/Unload As Needed

There are only 2 functions you need to call for the entire library.

First, when you want to use the stored graphics, call load_stored_gfx() and pass it your compressed graphics string (eg. my_gfx) in this example.

When you are done with it, simply call restore_gfx() to return the sprite sheet to its original form.

P#63133 2019-03-31 04:18 ( Edited 2019-03-31 04:22)

SHOW MORE

Cart #biyakigaha-0 | 2018-12-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
26

Day 1 of the 2018 Pico-8 Advent Calendar!


Thanks for checking out my entry for our community "Pico-8 Advent Calendar"!

It's a simple "race the clock" arcade game, with the goal of delivering as many presents as possible before sunrise. The entire game only lasts about a minute, with the idea that you will play many times, and try to beat your previous high score.

Credits:

Design and Code: https://twitter.com/matthughson
Art: https://twitter.com/hoybhoyb
Sound and Music: https://twitter.com/gruber_music
3D FX and Intro: https://twitter.com/2DArray

About Pico-8 Advent Calender:

During December, each day will be filled with new and exciting PICO-8 games! We have gathered 25 great developers from the PICO-8 community and we have worked hard to make some new games. Each day leading up to Christmas, there will be a new surprise for you!

Find out more at: https://pico8-advent.tumblr.com/

And check out the Pico-8 Advent Calendar each day for a new suprise: https://www.lexaloffle.com/bbs/?tid=32388

P#59372 2018-11-26 23:38 ( Edited 2018-12-01 18:12)

SHOW MORE

Uncompressed Source Code: https://paste.ee/p/5KOG5 (warning: it's pretty gross)

Late last year (2017) I started work on a port of Super Mario Bros [NES] to Pico-8. The goal was to be authentic as possible to the original game, while working within the Pico-8 limitations. Something like Super Mario Bros Deluxe [GBC] (https://www.mariowiki.com/Super_Mario_Bros._Deluxe).

In the end I was able to get 1-1 and 1-2 mostly complete before starting to hit serious memory limits which make it seem near impossible to ship the full game.

With that in mind, I'm releasing it as-is for now so that people can check it out and see where it was headed.

If you are curious, the biggest factor for memory is the level data which is quite huge. At some point I'd like to document how my level authoring process worked, but for now you can check out this twitter thread of me slowly wittling down the level data size:

https://twitter.com/matthughson/status/929194247202340864

Update: I have managed to squeeze in all for World 1 now!

Music by: https://twitter.com/gruber_music

P#55697 2018-08-26 01:28 ( Edited 2021-06-12 21:05)

SHOW MORE

Cart #48640 | 2018-01-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

P#48641 2018-01-28 12:12 ( Edited 2018-01-28 17:12)

SHOW MORE

Cart #47932 | 2018-01-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#47930 2018-01-07 01:22 ( Edited 2018-01-07 06:25)

SHOW MORE

Cart #47931 | 2018-01-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#47926 2018-01-07 01:01 ( Edited 2018-01-07 06:24)

SHOW MORE

Hi,

I am trying to store some binary data as a string in lua, like so:

local data="ã.ç.G W.§.Ó.×..."

but after saving, all common ascii characters in this string get moved to lowercase:

local data="ã.ç.g w.§.Ó.×..." --(note: G and W are now g and w)

Is there anyway to prevent this?

Thanks!

P#47004 2017-12-04 02:08 ( Edited 2018-01-18 22:00)

SHOW MORE

Is it possible to get the current Camera position stored in the DrawState?

I'm writing my own map() function, and want to hook into the built in camera functionality.

Thanks!

P#45945 2017-11-06 20:09 ( Edited 2017-11-07 06:52)

SHOW MORE

Use arrow keys to move. Eliminate all the enemies.

P#39837 2017-04-23 00:54 ( Edited 2017-04-23 04:54)

SHOW MORE

Cart #38530 | 2017-03-22 | Code ▽ | Embed ▽ | No License
5

Cart #38357 | 2017-03-18 | Code ▽ | Embed ▽ | No License
5

P#38358 2017-03-18 02:23 ( Edited 2017-03-23 05:00)

SHOW MORE

Cart #39947 | 2017-04-26 | Code ▽ | Embed ▽ | No License
137

Art by: 9tk (https://www.lexaloffle.com/bbs/?uid=23566)
Code by: mhughson (https://www.lexaloffle.com/bbs/?uid=15406)
Sound by: gruber music (https://twitter.com/gruber_music)

Previous Versions:

Cart #39706 | 2017-04-15 | Code ▽ | Embed ▽ | No License
137

Cart #39098 | 2017-04-05 | Code ▽ | Embed ▽ | No License
137

Cart #39021 | 2017-04-03 | Code ▽ | Embed ▽ | No License
137

Cart #38834 | 2017-03-29 | Code ▽ | Embed ▽ | No License
137

Cart #38770 | 2017-03-27 | Code ▽ | Embed ▽ | No License
137

Cart #38741 | 2017-03-26 | Code ▽ | Embed ▽ | No License
137

Cart #38605 | 2017-03-23 | Code ▽ | Embed ▽ | No License
137

Cart #38496 | 2017-03-21 | Code ▽ | Embed ▽ | No License
137

Cart #38398 | 2017-03-19 | Code ▽ | Embed ▽ | No License
137

Cart #38300 | 2017-03-17 | Code ▽ | Embed ▽ | No License
137

Cart #38204 | 2017-03-12 | Code ▽ | Embed ▽ | No License
137

Cart #38172 | 2017-03-12 | Code ▽ | Embed ▽ | No License
137

Cart #38148 | 2017-03-11 | Code ▽ | Embed ▽ | No License
137

Cart #38129 | 2017-03-10 | Code ▽ | Embed ▽ | No License
137

Cart #38116 | 2017-03-09 | Code ▽ | Embed ▽ | No License
137

P#38117 2017-03-09 02:34 ( Edited 2018-09-10 05:00)

SHOW MORE

Cart #37989 | 2017-03-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

P#37990 2017-03-02 02:19 ( Edited 2017-03-02 07:19)

SHOW MORE

Cart #37404 | 2017-02-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
10

Testing out my Advanced Micro Platformer Starter Kit's ability to handle 16x16 sprites (vs more common 8x8 used in a lot of pico-8 games).

P#37405 2017-02-12 20:10 ( Edited 2017-02-13 02:45)

SHOW MORE

I have taken my most recent Pico-8 game Kid Bludd, stripped it down to the essentials, and I am releasing it as a kind of Platforming Game Starter Kit.

I removed all logic that isn't game agnostic, so it is hopefully a good starting point for pretty much any platformer.

It's not super complicated, but does a lot of stuff I see many games not doing, which I consider table stakes for a platformer that feel good.

Features the basics:

  • Animation System
  • Collision Routines
  • Camera (w/Shake)
  • But also...

Forgiving Jumps

This one is very subtle but one of the most important pieces of a platformer. In general the player can only jump if they are on the ground, but this can make the game feel unresponsive when trying to make precision jumps. To give the player some leeway, the game allows jumps for a few frames after the player leaves a platform, and also registers jump presses if they came a few frames before landing.

Mario Sliding

When you change direction while moving, there is a bit of a slide before moving in the new direction.

Air and Ground Friction

Tunable values for both how much the player slows down while in the air and when touching the ground. This is critical for allowing the player to land on small platforms, while maintaining a good feeling in the air.

Variable Jump Height

Tap to jump a small amount, and hold to jump higher. Again very critical for precision jumps.

Pass Through Floors

Some floors allow the player to jump up through them, but not down. Really important for any levels with verticality, but also fun for horizontal scrollers.

Camera Scrolling Threshold

This cart uses the same camera style as metroid, where the player must leave a small area in the center of the screen before it starts scrolling. This give the player the freedom to make minor movements without causing nauseating camera movements.

This is a follow up to my original cart: "Micro Platformer - Simple Platforming Engine in 100 Lines of Code". If you are new to programming, I strongly suggest starting with that cart, as it is much simpler to follow!


Old Versions:



P#37158 2017-02-04 19:18 ( Edited 2020-12-27 06:02)

SHOW MORE

Short demo showing how to do animations with nothing but palette cycling.

On the right is the actual sprite used, with not palette cycling.

On the left is the resulting animation, when cycling through the palette.

A very primitive example of the amazing techniques seen here: http://www.effectgames.com/demos/canvascycle/?sound=0

Disclaimer: I'm not an artist, so it would be great to see an actual pixel artist do something with this. :)

P#36841 2017-01-29 01:48 ( Edited 2017-01-29 06:52)

SHOW MORE

My 12th one-game-a-month project, and my 4th Pico-8 game.

Loosely inspire by Bubble Bobble, but with a darker, more action-packed twist.




P#36438 2017-01-22 21:34 ( Edited 2018-11-25 18:02)

SHOW MORE

Is it possible to pause or mute music in Pico-8 from script?

I want to halt the music for a short period when the player dies, and resume it when they respawn. Pause or Mute would both work in this case; I just don't want to restart the whole song every time they die.

Thanks!

This is what I currently do:

-- Player Spawns...
music(0)

--Player dies
music(-1)

-- Player Spawns...
music(0)
P#35493 2017-01-11 20:59 ( Edited 2017-01-12 01:59)

View Older Posts
Follow Lexaloffle:          
Generated 2024-03-19 07:36:32 | 0.106s | Q:99