Log In  

Cart #dancejab-0 | 2019-11-14 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

This fighting game has only one attack - JAB!
Shuffle and dash till the timing is right to - JAB!
Or footsie to bait your opponent then - JAB!
Hold centre stage. Don't fall off. Dance. JAB!

Inspired by Super Smash Bros. and Divekick.

Two players can share a keyboard. For player 1 the arrow keys move, N dashes and M jabs. For player two, ESDF moves, tab dashes and Q jabs.

Also available on itch.io here:
https://davbo.itch.io/dancejab


Thanks to those who playtested and supported us!

Thanks to TRASEVOL_DOG for the sprite compression code found here: https://www.lexaloffle.com/bbs/?pid=40008 . You can check out his projects here: https://trasevol-dog.itch.io/

Thanks to Zep for making the Pico-8 and for the background code we adapted from here: https://twitter.com/lexaloffle/status/1149043190218891264

Code on GitHub here:
https://github.com/davidjtferguson/dancejab

Made with love by
Davbo and Rory~

P#69899 2019-11-14 20:36 ( Edited 2019-11-14 21:03)

:: Thom

I really like this game, but how might player two be controlled?

P#69900 2019-11-14 20:47
:: Davbo

Ah, I'll add controls to the description!
On Pico 8 games in general ESDF is the arrow keys for the second player, and Tab and Q are the O and X keys. If you're running the game on itch.io or locally you can also plug in two xbox controllers.

P#69901 2019-11-14 20:58
:: dw817

Superb work for a 2-player game, @Davbo. Wait for it. Here is your stamp.

Also was looking at your:

hex2dec={["0"]=0,["1"]=1,["2"]=2,["3"]=3,["4"]=4,["5"]=5,["6"]=6,["7"]=7,["8"]=8,["9"]=9,["a"]=10,["b"]=11,["c"]=12,["d"]=13,["e"]=14,["f"]=15}

Might be smaller code and more readable as:

hex2dec={}
for i=1,16 do
  hex2dec[i-1]=sub("0123456789abcdef",i,i)
end

Oh wait, you're doing it in reverse.
Hmm ... Let me think for a second ...

hex2dec={}
for i=1,16 do
  c=sub("0123456789abcdef",i,i)
  hex2dec[c]=i-1
end

Still a bit more readable, may be the same code size now.

Also looking at @TRASEVOL_DOG compressor, the one you used in your cart. Quite a bit different than the way I make a shrink file.

...
  repeat
    c=sub(t,i,i) n=1 i+=1
    repeat
      ok=1
      if (c==sub(t,i,i)) n+=1 i+=1 ok=0
    until ok==1 or n==32767
    d="&"
...

Tried your logo, my compressor came out to 6800-characters whereas yours is 4964-characters.

I think there's something I can learn from this and perhaps program an image compressor that surpasses yours as well as mine.

P#69904 2019-11-14 21:49 ( Edited 2019-11-14 23:20)
:: Thom

Thanks for the help!

P#69923 2019-11-15 15:40
:: dw817

I hadn't forgotten about you. I just needed a few days to figure out what was going on in your compression.

Now I know - and I have some good news and bad news for you, @Davbo. Your picture is unique in that it does not have a large number of black lines in it.

This aids in compression for this kind. If you do any other image say a dithered portrait photo, you won't get as good compression.

So saying here is the fruit of my labors for the past few days.

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

VVhat's going on here ?

This particular compressor looks for matching colored pixels that are next to each other horizontally. It does not take into account vertically matching colored pixels, and I'm thinking it should. A project for another day perhaps ?

As it is though it takes the decompressed picture of your logo at 16384-chars and compresses down to 3309-chars. A whopping 79% compression, that is my compressor takes your image and cuts out almost 80% of the bulk leaving 21% of the final size remaining.

I still think this can be improved upon - but for later.

Here is the code. You can paste this direct to check it as your logo is also included in the source.

-- new picture compressor
-- written by dw817 (11-19-19)

-- standard ⌂ pico-8 license

function main() ------------->>

chr6,asc6,char6={},{},"[email protected]#$%^&*()-_=+[{]};:'|,<.>/?"
for i=0,63 do
  c=sub(char6,i+1,i+1)
  chr6[i]=c
  asc6[c]=i
end
char6=nil

-- logo for two boxers, 16384
-- chars.
img="101100001101111111111111111111111111111111111111111111111111111111111111111011101110111111111111111111111111111111011101000000000111010010111011111111111111111111111111111111111111111111111111111111111101111111011111111111111111111111111111111111110000000011101100001101111111111111111111111111111111111111111111111111111111111111111011111110111111111111111111111111111111011101000000110111010010111111111111111111111111111111111111111111111111111111111111111101111111011111111111111111111111111111111110110000001011101100001111111111111111111111111111111111111111111111111111111111111111111111111110111111111111111111111111111111011101000001111171777777171111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110110000111011777777777777111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011101001101117777777777777717111111111111111111111111111111111111111111111111111111111111111111777717111111111111111111111111111110110011111077777777777777771111111111111111111111111111111111111111111111111111111111111177777777771111111111117117111111111111011101111101778788887877777717111111111111111111111111111111111111111111111111111111117177777777777717111111117177777711111111111110111111117787888888887877771711111111111111111111111111111111111111111111111111717777777777cccc771711111111777777771711111111110111111111778788888888888877771111111111111111111111111111111177777777777717717777777777cccccccc7c771111111177c7cc77171111111111111011111177878888888888887877171111111111111111111111111171777777777777777777777777c7cccccccccc7c771111117177cccc717711111111111101111111778788888888888888777711111111111111111111111171777777778788888877777777cccccccccccccc7c771111117177cccc11771111111111111111111177878888888888888878771711111111111111717717117777878888888888887877cccccccccccccccccc717711111177c7cccc11771111110111111111111177878888228288888878771711111111111177777777777777888888888888887877cccccccccccccc1111717711111177c7cc1c11771111111110011111111177878888227287888888777711111111117777777777777787888888882272887877cccccccccc1c111111777711111177c7cc1c71771111111101111011111177878888227277888888777711111111717777888878777788888888282277887877cccccccc1c11117177771711111177c7cc1c71171111111111100111111177778888227277878888777771777777777788888888788788882288287287887877cc7cc7cccc11777777171111111177cccc1c711711111111110111111111777788882872777788887877777777777787888888887887882822888888888878c77c7777cccc11777777777777117177cccc1177777711111111111011111177778888287277778888787777777777778888888888288888282288888888787777777777cccc11777777777777777177cccc1177777777111111110111111177778888287277778788887777778778778888282288288888227288888888777777777777cccc1c717777777777777777cccccccc1c7177171111111111111177778888287277778788887788888888778888222282288888227788882877778877177177c7cc1c717777cccc777777c7cccccccccc1171771111111111111177778888287277778788287788888888728828227787288888227787888822828878171177c7cccc7177cccccccccc71c7cccccccccc1c11771111111111111171778888287277778788228888888888228828727787288888727787888888888878171177c7cccc11c7cccccccccc11c7cccc11cccc1c1177171111111111117177888828227777878882882822828822882872778788888872778788888888887817117177cccc11ccccccc1cccc11cccc1c1111cccc1171171111111111117177888888227777872888882222828822882872778788888872777787888888887717117177cccc11cccc1111c1cc11cccc1c1171c7cc1c71171111111111117177888888227777872888282277878828822872778788888828777777888888777717117177cccc11cccc1171c7cc1ccccc1c1177c7cc1c71171111111111117177888888227777878888287277878828822872778788828888888822777777777711117177c7cc1ccc1c1177c7cc1ccccc111177c7cc1c71171111111111117177888888227777888888287777878828822872778788828888888828727777771711117177c7cc1ccc1c7177c7cc1ccccc117177c7cc1c71171111111011117177888888227777888888287777878888822872777788288888888828727777771111117177c7cc1ccccc7177cccc1ccccccc7177cccc1c71171111110111117177878888227787888888287777888888882872777777778888888828721711111111777777cccc1ccccc1cc7ccccccc1cccccccccccc1171171111111110117177878888227787882888887788888888882877177777777788888822771711117777777777cccc1c77cccccccccccc7ccccccccccccc11711711111111111171778788882287888828888888888887887877771771777777777777777711117177777777cccccc1c77cccccccc7ccc7777cccccccc1c117717111111111111717787888822888888888288888878778877777711111171777777777777111177c7cccccccccccc7c77c7cccccc77777777c7cccc1c11717711111111111111717787888882888888888288888878777777771711111111717777777717111177cccccccccccccc777777777777777777777717111171771711111111111111717787888888888888882788887877777777111111111111111111111111111177cccccccccccc7c777777777777771111777777777777771111111111101111717787888888888888787777777777777717111111111111111111111111111177c7cccccccc7c7777117177771711111111777777777717111101111101111171778788888888882877777777777711111111111111111111111111111111117777cccccc7c77771711111111111111111111717777111111111110111110117177878888888888727777777777111111111111111111111111111111111111717777777777771711111111111111111111111111111111111111011110011111778788888888787777171111111111111111111111111111111111111111111177777777771111111111111111111111111111111111111111111110111110117787888888887777771111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111011177878888887777771711111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110111110778788887777771711111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110011111017777777777771711111111111111111111111111111111111111111111111111111111111111222222222222222222222222111111111111111111011110111177777777771711111111111111111111111111111111111111111111111111111111111121222222222222222222222222222222111111111111111111111111777777771711111111111111111111111111111111111111111111117177171111111121222222222222222222222222222222222211111111111111111111117777171111111111111111111111111111111111111111111111111177777711111111222222222222222222222222222222222222222212110111111011111111011111111111111111117711111111111111111111111111111171777777171111212222222222222222222222222222222222222222221211101101111111111110111111111111117177171111111111111111111111111111717777771711112122222282888888888888888888888828222222222222120111111011111111111111111111111171771711111111111111111111111111117177777717111121222282888888888888888888888888888888282222222211101101111111111111111111111111117711111111111111111111771711111171777777171111222282888888888888888888888888888888888888222222120111111111111111111111111111111111111111111111111111717777111111117777771111112222828888888888888888888888888888888888888822222211111111111111111111111111111111111111111111171111117177771111111171771711112122228288888888888888888888888888888888888888882222121111111111111111111111111111111111111111717711111171777711111111111111111122222288888888888888888888888888888888888888888828221211111111111111111111111111111111111111111117111111117717111111111111111111222222888888888888888888888888888888888888888888882212111111111111111111111111111111111111111111111111111111111111111111111111112222228888888888888888888888888888888888888888888828221111111111111111111111111111111111111111111111111111111111111111111111112122222288888888888888888888888888888888888888888888282211111111111111111111111111111111111111111111111111111111111111111111111121222282888888888888886866666688888888888888888888882822111111111111111111111111111111111111111111711711111111d1dddddd11111111112122228288888888888888686666666666666688888888888888282211111111111111111111111111111111111111111171171111d1dddddddddddd11111111212222888888888888888868666666666666666666666666868888221111111111111111d1dddddddddddddddddd111111111111d1dddddddddddddd1d11111121222288888888888888886866666666666666666666666686888822111111111111d1dddddddddddddddddddddddd1111111111dddddddddddddddddddd11112222228888888888888888686666666666666666666666668688882211111111d1dddddddddddddddddddddddddddddd1d1111d1dddddddddddddddddddd1d1122222288888888888888888866666666666666666666666686888822111111d1dddddddddddddddddddddddddddddddddd1d11ddddddcdccccccccdddddddd11222222888888888888888888666666666666666666666666888888221111d1ddddddddddddddddddddddddddddddddddddddd1ddddcdccccccccccccdddddd1d222222888888888888888888666666666666666666666666888888221111ddddddddddddccccccccccccccccccdcddddddddddddddccccccccccccccccdcdd1d2222228888888888888888886866666666666666666666668888882211d1ddddddddccccccccccccccccccccccccdcddddddddddcdccccccccccccccccccdddd2222228888888888888888886866666666666666666666668888882211ddddddcdccccccccccccccccccccccccccccccddddddddcdccccccccccccccccccdddd2222228888888888888888888888888888888866666666868888882211ddddddccccccccccccccccccccccccccccccccdcddddddccccccccccccccccccccdcdd2d222288888888888888888888888888888888888888888888888822d1ddddcdccccccccccccccccccccccccccccccccdcddddcdccccccccccccccccccccdcdd2d222288888888888888888888888888888888888888888888888822d1ddddcdccccccccccccccccccccccccccccccccdcddddcdccccccccccccccccccccdcdddd222288888888888888888888888888888888888888888888888822ddddddccccccccccccccccccccccccccccccccccdcddddccccccccccccccccccccccdcdddd222288888888888888884844444444888888888888444444848822ddddddccccccccccccccccccccccccccccccccccdcddddccccccccccccccccccccccccdddd222288888888888888484444444444444444444444444444882822ddddddcccccccccccccccccccccccccccc7cccccdcddddccccccccccccccccccccccccdddd222288888888888888884444444444444444444444444444882822ddddcdcccccccccccccccccccccccccccc77c7ccdcddddccccccccccccccccccccccccdddd222288888888888888884411114444444444444444441411882822ddddcd6ccccccccccccccccccccccccccc7cccccdcddcdccccccccccccccccccccccccdddd222288888888888888884811111111414444444411111111882822ddddcd6cccccccccccccccccccccccccccccccccdcddcdccccccccccccccccccccccccdddddd2d82888888888888888811111111114444441411111111882822ddddcc6666ccccccccccccccccccccccccccccccddddcdcccccccc2222222222ccccccdddddddd82888888888888888811111111114444441111111111882222ddddcc666666666666ccccccccccccccccccccccddddcdcccc2c22222222222222ccccdddddddd8d888888888888888811111111114444441111111141882222ddddcc666666666666666666666666ccccccccccddddcdcc2c2222222222222222c2ccdddddddddd8d8888888888888811114444444444441111444488882222ddcdcc666666666666666666666666ccccccccccddddcd2222222222222222222222d2ddddccdcdd8d8888888888888811114444444444441111444488882222ddcdcc666666666666666666666666ccccccccccdddd2d222222222222222222222222ddddccccdddd8888888888888818414444444444441441448488882822ddcdcc666666666666666666666666ccccccccccdd2d22222288888888882822222222d2ccccccdddd8888888888888888882244444444444444448288882822ddcdcc666666666666666666666666ccccccccccdd222222828888888888882822222222ccccccdddd8888888888888888882842444444444444248288882822ddcdcc666666666666666666666666cccccccccc2c222282888888888888888828222222ccccccdcdd8d88888888888888888822444444444444248888882822ddcdcccc6666666666666666666666cccccccccc22222288888888888888888888282222ccccccdcdd2d82888888888888888822444444444444228888882822ddcdcccc6666666666666666666666cccccccccc22228288888888888888888888282222c2ccccdcdd2d22828888888888888822444444444424228888882222ddcdcccccccccc6c66666666666666cccccccc2c22228888888888888888888888882222c2ccccdcdd8d22228288888888888822444444444422228888222222ddcdcccccccccccccccccccccccccccccccccc2c2282888888888888888888888888222222ccccdcdd8d88222288888888888822444444442222228228222212ddcdcceceececccccccccccccccccccccccccc222288888888888888888888888888282222ccccdcdd8d88882882888888882822222222222222222222222212ddcdcceceeeecccccccccccccccccccccccccc222288888888888888888888888888282222ccccdcdd8d88888888888888882222222222222222222222222211ddcccceceeeececccccccceceeeeeeeeeecc2c228288888888888888888888888888282222ccccdcdd8d88888888882822222222222222222222222222221211ddcccc2ce2eeeeeeeeeeeeeeeeeeeeeeeecc2c228288888888888888888888888888882222ccccdddd8d88888888882822222222282222222222222222221111ddcccccc2222eeeeeeeeeeeeeeeeeeeeeecc2c228288888888888888888888888888882222ccdcdddd8888888888882822228288888888888828222222111111cdcccccc222222e2eeeeeeeeeeeeeeeececc2c228288888888888888888888888888882222ccdddd8d8878888888888888888888888888888888882812111111cdcccccc222222e2eeeeee22222222e2cecc2c228288888888888888888888888888882222dddddd888877878888888888888888888888888888882822111111cdcccccc2c2222e2eeeeee22222222c2cccc2c228288888888888888888888888888882222dddddd888878888888888888888888888888888888882822111111cdccccccec2222e2eeeeee22222222c2cccc2c228288888888888888888888888888882222dddd2d818888888888888888888888888888888888888822121111cdccccccccee22e2eeeeee2e222222cccccc2c228288888888888888888888888888882222dddd2d222288888888888888888888888888888888888822121111cdccccccccec22eeeeeeeeeeee2ec2cccccc2c228288888888888888888888888888282222dd2d22222222888888888888888888888888888888888822221111cdcccccccceceeeeeeeeeeeeee2ecccccccc2c228288888888888888888888888888282222112222222222228888888888888888888888888888888822221111ddcccccccccceeeeeeeeeeeeeeddcccccccc2c222288888888888888828888888888282222111111222222222288888888888888687777777777777777776711ddcdcccccccccceeeeeeeeeededdccccccccdd2222888888888888228888888888882222221111111122222222228288888888887877d7116dd17777771d7d10ddddcccccccccceceeeeeeeeddddccccccdcdd222282888888882282888888888888222222111111111121222222228888888888787717666166777777617100ddddddccccccccccccccccecddddccccccdddd222282888888222288888888888888222212111111111111222222228888888888787711111ddd111d71117101d1ddddcdccccccccccccccccddddccccccddcd2222222222222288888888888888882222111111111111111122222222888888887817d177111766617161711111ddddcdccccccccccccccccddcdccccdcddcc2c2222222222828888888888888828222211711711111111111122222288888888781d7dd7711dd111771d7d11d1ddddcdccccccccccccccccddddccccdcddcccc2222222222888888888888888828221211777711111177771111212282888888787777777777777777777711ddddddcdccccccccccccccccddddcdccddcdcccccc22222288888888888888888828221211777711117177771711212222888888787777777777777777777701ddddddccccccccccccccccccdcddcdccddcdcccccc2c222288888888888888888822221211711711117777777711112222888888787777776755657777777711ddddddccccccccccccccccccdcddcdccddcccccccccc228888888888888888882822221111111111117777777711112222888888787777775788587777777710dddd6dccccccccccccccccccccddcdcccccccccccccc228888888888888888882822221111111111117777777711112122888888787777775788587777777701dddd6666cccccccccccccccccccccccccccccccccccc228288888888888888882222221111111111117777777711112122828888787777565588585576777711dd6d6666cccccccccccccccccccccccccccccccccc2c222222888888888888282222121111111111117177771711102122628688787777959977676675777711dd6d666666c6cccccccccccccccccccccccccccccc2c222222828888882822222222121111111111111177771111011122626688787777959977676675777711dd6666666666c6cccccccccccccccccccccccccccc2c222222222222222222222222111111111117111111111111111022226666766755959977676655657711dd66666666666666ccccccccccccccccccddcccccccc2222222222222222222222221111111171771111111111111101222266667657aa7a77777777ee5e7710dd6666666666666666c6ccccccccccccccddcdccccdc2d22222222222222222222121171771111171111111111111111222266667657aa7a77777777ee5e7700dd6666666666666666666666ccccccccccddcdccccdccd22222222222222222212111177771711111111111111111111222266667657aa7a77777777ee5e7700cdcc666666666666666666666666666666ddcdcccccccccc22222222222222221111117777171111111111111111110122226666766755b5bb77d7dd55657700cccccc66666666666666666666666666d6ddcdcccccccccccc222222222222121111117777171111111111111111111122226666767777b5bb77d7dd75777700cccccccccc6666666666666666666666d6ddddcccccccccccccccccc222212111111117177111111111111111111111122226866767777b5bb77d7dd75777700cccccccccccccc666666666666666666d6ddddccccccccccc7ccccdcdddd111111111111111111111111111111111111222288667677775655cc5c5576777700cccccccccccccccc6c66666666666666ddddddcdcccccc7c77ccccdddddd111111111111111111111111111111111111222288887877777757cc5c7777777700cccccccccccccccccccc6c6666666666ddddddddccccccccc7ccccdddd1d111111111111111111111111111111111121222288887877777757cc5c7777777701ccccccccdcddddccccccccccccccccccddddddddcdccccccccdcdddddd1111111111111111111111111111111111112122228888787777776755657777777711ccccccddddddddccccccccccccccccdcdddddd1ddddddddddddddddd1d1111111111111111111111111111111111112122228888687777777777777777776711"

-- very short routine to unpack
-- and display it.
for i=1,16383,2 do
  poke(24576+i/2,"0x"..sub(img,i,i+1))
end

-- compress this screen to
-- string variable r
r=compresscrn()

repeat
  flip()
until btnp(4)

-- confirm the screen is clear.
cls()

repeat
  flip()
until btnp(4)

-- now decompress string back
-- to screen.
decompresscrn(r)

color(11)

-- show number of chars it is
-- when compressed.
?#r
n=flr((1-#r/16384)*100)
?"compressed "..n.."%"

repeat
  flip()
until forever

end --<<-----------------------

-- compress current 128x128
-- screen to return string
-- variable.
function compresscrn()
local b,p,r,l,n=0,0,"",0,0
  for i=0,16384 do
    c=pget(i%128,i/128)
    if c==l and n<15 then
      n+=1
    else
      for j=0,7 do
        if (band(n,2^j)>0 or band(l,2^(j-4))>0) b+=2^p
        p+=1 if (p==6) r=r..chr6[b] p=0 b=0
      end
      l=c n=0
    end
  end
  return r
end

-- decompress string of t that
-- has 128x128 picture in it.
function decompresscrn(t)
local b,p,c,n=0,1,0,0
  for i=-2,16383 do
    pset(i%128,i/128,c)
    if n>0 then
      n-=1
    else
      c=0
      for j=0,7 do
        if band(asc6[sub(t,p,p)],2^b)>0 then
          if j<4 then n+=2^j else c+=2^(j-4) end
        end
        b+=1 if (b==6) p+=1 b=0
      end
    end
  end
end

main()

HOPE THIS HELPS !

P#70050 2019-11-20 01:17

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2019-12-11 07:45 | 0.049s | 2097k | Q:51