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

Cart [#loop_n_scoop-1#] | Code | 2019-11-20 | No License | Embed

Work in progress for Game Off 2019!


v0.1 - initial wip submission
v0.1.1 - bugfix: runtime error when scoop is in player path right after completing an order

P#70074 2019-11-20 17:11 ( Edited 2019-11-20 18:12)

by dw817
Cart [#ha-1#] | Code | 2019-11-20 | License: CC4-BY-NC-SA | Embed

Having been experimenting with compressing screens of pixels I was wondering if it were possible to write a compressor that returned the results of a dithered image. That is, where the output results would be difficult or impossible to compress effectively using standard methods of image compression.

And this is a 1st stage. Tomorrow if I have time I'll work on and post the 2nd stage. If it's successful it will also dither an image but in a third of the current compression space (less than 512-chars) yet still span the full screen.

For instance this particular image compresses from 16384-chars (raw image) to 1457-chars. Obviously it does not include all 16-colors and instead relies on a black and white table that is a size of 5. Five because I want to have both solid black and white in it.

Yet I think this is useful, especially if someone wants to include a large number of "clipart" images in their cart and for them to be dithered, perhaps for an adventure or mystery game that relies on many pictures.

P#70058 2019-11-20 05:05 ( Edited 2019-11-20 05:08)

Cart [#packbat_palettes_demo-0#] | Code | 2019-11-20 | License: CC4-BY-NC-SA | Embed

I spent a while being very, very confused about screen palettes and draw palettes, but I've started to feel like I've got a hang of it? And I decided to make a visual expression of how these work as a PICO-8 cart.

In the default state, the screen palette contains the sixteen colors of the default palette - 0-15 - and the draw palette links the sixteen draw colors 0-15 directly to these default colors.

When the draw palette changes, different colors from the screen palette are loaded into the draw color slots. The sprite still refers to the same draw colors - in this case, 0-3 across the top, 4-7 in the second row, 8-11 in the second-to-bottom row, and 12-15 in the bottom row - but these draw colors have been redefined in terms of the screen palette.

...and the screen palette in turn can be redefined by changing the colors in its 16 slots.

I think how this is intended to be understood is:

  • 4 components: video output hardware (5-bit input, RGB output), screen palette RAM (4-bit address, 8-bit output), screen data RAM (14-bit address, 4-bit output), draw palette lookup table RAM (4-bit address, 4-bit output)
  • Every sixtieth of a second, one frame of graphics is sent to the monitor. As the hardware scans through the 128x128 pixels of the screen data, the 4-bit screen data output addresses the screen palette RAM, and the high-order bit plus lower 4 bits of the screen palette output goes to the video output hardware. (I can attest from having bugs in my screen palette code for a while that the other bits in the screen palette are ignored.)
  • When commands are run to draw graphics on the screen, the 4-bit addresses to be drawn go through the draw palette lookup table to set the 4 bits actually stored in the corresponding addresses of the screen data RAM.

Or, in less technical terms: the data stored for the sprite (or whatever) chooses a row in the draw palette (center) which chooses a row in the screen palette (left) which chooses a color on the screen. Changing the draw palette doesn't change what the screen shows until PICO-8 draws something new to the screen data; changing the screen palette does.

What honestly made it click for me, though, was thinking in practical terms.

The draw palette, for example, is a tool for recoloring images as I draw them. For example, if I have this little gray box stored as a sprite in my sprite sheet:

then I can use the draw palette to declare that I'm drawing it as an orange sprite instead:

The screen palette, on the other hand, I think of as 16 meanings. Rather than thinking of the, say, 11th color in the screen palette as a color, when I am using the screen palette to change the colors of images, I think of it by its purpose: in this case, the color of the character's shirt.

Then, changing that color represents a change corresponding to that meaning: to put the value 136 in screen palette slot 11, then, is to say that the color of the character's shirt is not green, it is red.

These ideas can obviously be combined - perhaps screen palette 1 is the color of player 1's vehicle and screen palette 2 is the color of player 2's vehicle, and which color is drawn when a vehicle sprite is drawn is selected using the draw palette. Thus, both players can select the colors of their vehicles and both vehicles can be drawn using the same sprites.

This is very long and probably well-known in the community, but I figured I'd make the tutorial anyway because I'm proud of figuring this out.

P#70054 2019-11-20 03:02

Cart [#marsmountain-1#] | Code | 2019-11-19 | License: CC4-BY-NC-SA | Embed

Day One Update!!

P#70040 2019-11-19 15:14 ( Edited 2019-11-19 20:10)

Some people tried to tell me that PICO-8 runs as fast as a host machine does (which, as we all know, is not true).

So I created this little "benchmark" cart with a roto-zoomer effect running in 60FPS. Use up/down keys to change the filled area of a screen. On my computer (MacBook Pro 2017) it consumes 98.2361% of PICO-8 CPU time at 47 lines.

Cart [#bekepezito-0#] | Code | 2019-11-19 | License: CC4-BY-NC-SA | Embed

P#70037 2019-11-19 09:45

Cart [#plsrush-0#] | Code | 2019-11-19 | License: CC4-BY-NC-SA | Embed

this is my lil partydemo for SIGGRAPH ASIA 2019's demoparty! pls excuse the dodgy code and music ;D

P#70035 2019-11-19 07:30

Cart [#runamazayi-0#] | Code | 2019-11-19 | License: CC4-BY-NC-SA | Embed
Ballpop by "The Snowmonkey"
Press left or right to aim,and z to fire.
Match three colors to get points.
When the flashing line reaches the top, game over.
Newball function modified from "Combo Pool".

P#70034 2019-11-19 05:39

Cart [#slide-0#] | Code | 2019-11-18 | No License | Embed

Slide, my Pico-8 version of the Rush Hour game. It contains 40 levels.

The object of the game is to get the red block out of the grid.

In menu:
L/R arrow keys to select level
x to start level

In game:
arrow keys to choose/move block
x to select/deselect block
c to cancel level and go to menu

P#70027 2019-11-18 21:12


As Tweets seem to be of interest, I thought I would share some shortcuts I have found over my time programming in Pico-8 which may save you vital characters to getting that desired 560-characters.

Let's look at some of the commands first:

Can be abbreviated as ? if first character on line

Not well-known will clear your variables and run your program again from the beginning.

Leaving out c and d will draw line from last drawn position using default color.

RECT(a,b,c,d) and RECTFILL(a,b,c,d)
Leaving out c and d will draw hollow or filled rectangle starting from coordinates 0,0, default color.

By itself will choose color 6.

Instead of creating tricky timers, just force your code to run at this FPS, can be higher than 60 too, 120 is possible !
Test that with this code:

for i=0,127 do
  for j=0,127 do

Can be abbreviated as T().

Use ::_:: and goto _ to GO TO a part of your code. Takes less space than REPEAT UNTIL false-condition.

if A==8 THEN A=0 END
Can be abbreviated:

To cut additional corners you can always cut spaces BEFORE any opening or AFTER ANY ending parenthesis ( ).

Likely there are other short-cuts of interest too. What are some you use to minimize your tweets with ?

P#70023 2019-11-18 19:43 ( Edited 2019-11-20 07:23)

Cart [#lucylovepebs-0#] | Code | 2019-11-18 | No License | Embed

This is Lucy Loves Pebbles, a game in 559 characters where you feed Lucy Miu with her favorite pellet-based food. #TweetTweetJam

Press X to flip the flippers and try to fling the pebbles into the cat's mouth. If she eats enough, she'll be happy - otherwise, well, nothing happens.

I'd never tried to minify game code before - only demos for #tweetcart. As it turned out, I made two choices that would make this one very difficult to minify: I spent a stupid number of characters drawing the cat head exactly as I wanted (instead of picking cheaper graphics for it) and I chose game mechanics that were really much more complex than I ought to have chosen.

The implementation was fairly straightforward: the left side of the screen (i.e., the cat's face and rail/flipper) are drawn with primitives, then memcpy/spr-flipped to the other side. I use the distance to center to determine what happens when the flippers are pressed, and the height to determine if it makes it in the cat's mouth.

For minifying, I wrote a small python script that would read a less-minified cartridge and output the one I've uploaded. Essentially, it strips indents, some whitespace, and comments, and allows me to use comments to decorate which lines' newline characters can be deleted.

Yes, this may be my worst cartridge, but it was a fun weekend!

P#70021 2019-11-18 17:17

Cart [#tedepujoti-0#] | Code | 2019-11-18 | No License | Embed
Hello Pico-8 community. This is my first game so i'm sorry for the sloppy code. I am coding a shoot em' up game and I have a problem. When the M button is pressed a circle of bullets are created. The left, right, up, and down bullets can hit you. But the bullets in between are calculated with non integers. Since the players ship moves in increments of 1 the bullet and the ship will never collide. How could I change this? Thanks for the help in advance.

P#70008 2019-11-18 06:05 ( Edited 2019-11-18 06:14)

Hey guys, I'm trying to add Player 2 controls but it looks like it's not working for me. I'm trying to do btnp(S) and btnp(f) etc for 2nd player controls and that's not working.

Is there anything specific I have to write/do to enable two players?

P#70005 2019-11-18 04:22

Cart [#fuwikufuzi-1#] | Code | 2019-11-18 | License: CC4-BY-NC-SA | Embed

Made for a class involving learning on Pico-8. Totally understand there are a lot of these clones out here for multiple classes. Thanks for looking.

P#70000 2019-11-18 03:37

Cart [#bepumerika-0#] | Code | 2019-11-18 | License: CC4-BY-NC-SA | Embed

This was a school project. This is the completed state in which i am turning in. Still plan on working on this and adding more to it in the future.

The goal is to break all the bricks. The game has 3 levels, if you can see what the 3rd level is shaped like post a comment on what you think it is. This is a remake or similar copy of breakout or brick-breaker.

P#69995 2019-11-18 00:49 ( Edited 2019-11-18 00:50)

Cart [#rtupewre-0#] | Code | 2019-11-17 | No License | Embed

This is a very rough breakout game that I made for a video game development class.

P#69992 2019-11-17 23:11

Cart [#twep-0#] | Code | 2019-11-17 | License: CC4-BY-NC-SA | Embed

This is my submission for the #TweetTweetJam. Use the arrow keys to dodge things. I was able to fit saving and a sound in the 560 characters as well! Also play on itch.io.

P#69991 2019-11-17 22:17 ( Edited 2019-11-17 22:21)

I have a new version with some control improvements, so I hope, that this will be ok for you

Cart [#solitaire_by_myshaak-2#] | Code | 2019-11-19 | License: CC4-BY-NC-SA | Embed

Cart [#solitaire_by_myshaak-1#] | Code | 2019-11-17 | License: CC4-BY-NC-SA | Embed

P#69990 2019-11-17 21:53 ( Edited 2019-11-19 10:11)

Cart [#rainbow_tunnel-0#] | Code | 2019-11-17 | License: CC4-BY-NC-SA | Embed

This is my first TweetTweetCart (558 chars of code)! Made for TweetTweetJam 3!

<> to move
Z to jump

My best score is 560
Itch page: Rainbow Tunnel

Have fun!

P#69989 2019-11-17 21:19 ( Edited 2019-11-19 13:39)

Cart [#marcus11-0#] | Code | 2019-11-17 | License: CC4-BY-NC-SA | Embed

P#69987 2019-11-17 21:05 ( Edited 2019-11-17 22:29)

Cart [#zimibidaja-0#] | Code | 2019-11-17 | No License | Embed

P#69985 2019-11-17 19:55
View Older Posts
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-11-20 20:53 | 0.124s | 4194k | Q:231