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 :: ]

V1.1 Changes:

  • Level 12 is completely redone
  • Current level number is shown in top right
  • Auto jumping is prevented
  • Wolrd 3(level 9-12) invisible blocks are a bit more visible
  • Hitting the top of a block is more forgiving

Cart #singlejump_v1_1-0 | 2020-06-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

You are a slime that can only jump once, but with the help of jump coins you'll be able to jump once more.

This is my first game made with Pico-8 and my first try at game dev as a whole.

Please enjoy :)

Cart #singlejump-0 | 2020-06-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

P#78590 2020-06-27 21:39 ( Edited 2020-06-28 19:25)
[ :: Read More :: ]

I'm working on my first PICO-8 game which is also the first time I really got into programming. Now I almost hit the token count but I don't really know how to shorten the code. I also admit I got really careless when writing the code and was mostly just happy whenever it worked. In at least three instances I'm 100% certain there needs to be a much more efficient way to code, any experienced programmer will probably cringe so bear with me.
But I'd really appreciate any help!

The first code is a function that adds text to the screen with each sentence delayed.
oprint2() is just a function I copied from Sophie Houldens talkthrough of Curse of Greed which adds an outline to the text.
Right now there are six texts but I want this function to work with an even greater number of texts and to able to make changes without so much hussle!
The text content and the if-statements to trigger them are always different.
The text style/colors are always the same. Right now I have individual timer variables are for each text which I realize is horrible. If it helps, I'd have no problem with all texts having the same speed.

function intro()

camera()
controls()
if ending_init==0 then
 if help==1 then
  if game_start_t <= 320 then
   oprint2("            move\n\n        ⬅️ ⬆️ ⬇️ ➡️",8,24,0,15)
  end
  if game_start_t >= 180 and game_start_t <= 460 then
   oprint2("\n\n  search for hints\n\n         ❎",8,44,0,15)
  end
  if game_start_t >= 370 and game_start_t <= 530 then
   oprint2("\n\nsearch through our belongings\n\n              ❎",8,64,0,15)
  end
  if game_start_t >= 500 and game_start_t <= 700 then
   oprint2("\n\n        surrender\n\n              🅾️",8,84,0,15)
  end
  if game_start_t <= 710 then
   game_start_t += 1
  end
 end

 if p.keys >= 1 and dget(2)!=1 then
  if key_timer <= 240 then
   oprint2("      a key",8,24,0,15)
  end
  if key_timer >= 50 and key_timer <= 270 then
   oprint2("\n\n  opens either a chest\n\n    or a door",8,34,0,15)
  end
  if key_timer >= 120 and key_timer <= 300 then
   oprint2("  and might only fit once.",8,82,0,15)
  end
  if key_timer <= 310 then
   key_timer+=1
  else
   dset(2,1)
  end
 end

 if steponfv >= 1 and dget(3)!=1 then
  if stepon_timer <= 240 then
   oprint2("every small decision",8,24,0,15)
  end
  if stepon_timer >= 50 and stepon_timer <= 270 then
   oprint2("\n\n  will\n\n    influence",8,34,0,15)
  end
  if stepon_timer >= 120 and stepon_timer <= 300 then
   oprint2("  our fate.",8,82,0,15)
  end
  if stepon_timer <= 310 then
   stepon_timer+=1
  else
   dset(3,1)
  end
 end

 if musx == 7 and musy == 3 then
  if restart_timer >= 350 and restart_timer <= 600 then
   oprint2("the heart of the desert",8,24,0,15)
  end
  if restart_timer >= 700 and restart_timer <= 1000 then
   oprint2("\n\nwhere everything ends\n\n  and everything begins ...",8,34,0,15)
  end
  if restart_timer >= 1100 and restart_timer <= 1400 then
   oprint2("we came so far this time",8,54,0,15)
  end
  if restart_timer >= 1500 and restart_timer <= 1800 then
   oprint2("are you ready\n\n to unlearn everything\n\n   again ...?",8,74,0,15)
  end
   restart_timer+=1
  if restart_timer >= 1980 then
  poke(rnd(23800),rnd(0x100))
  end
 end

 if musx == 1 and musy == 0 and hiddendoorv == 0 and greedv == 0 and steponv == 0 and steponfv == 0 and textreadv==0 and ending_i==0 then
  if east_timer >= 50 and east_timer <= 250 then
   oprint2("this is not the empty room ...",8,24,0,15)
  end
  if east_timer >= 200 and east_timer <= 300 then
   oprint2("we shall head east\n\n   and ascend!",8,44,0,15)
  end
  if east_timer <= 310 then
  east_timer+=1
  end
 end

 if musx == 4 and musy == 0 and hiddendoorv != 0 and textreadv !=0 then
  if empty_timer >= 30 and empty_timer <= 120 then
   oprint2("my mind is restless",8,24,0,15)
  end
  if empty_timer >= 140 and empty_timer <= 220 then
   oprint2("the noise is unbearing",8,44,0,15)
  end
  if empty_timer <= 230 then
  empty_timer+=1
  end
 end

end
end

The second code teleports the player from certain map tiles to others when stepped on.
Sometimes it works two ways but then it changes to one tile in either x or y to prevent a loop.
My problem is again that the if-statements are always different so I don't know how to group them together and sometimes there are multiple if-statements or they require different variables than p.x and p.y.

function desert_teleport()
if ending_init== 0 then
 if greedv >= greed_one then
  if p.x == 1 and p.y == 1 then
   p.x = 49
   p.y = 1
  end
 elseif hiddendoorv >= hiddendoor_one then
  if p.x == 4 and p.y == 6 then
    p.x = 88
    p.y = 54
   end
 elseif textreadv >= textread_one then
  if p.x == 79 and p.y == 60 then
    p.x = 121
    p.y = 25
  end
 end

 if (p.x >= 112 and p.x <= 127 and p.y == 47) or (p.y >= 16 and p.y <= 47 and p.x == 127)  then
  p.x = flr(rnd(14)) + 97
  p.y = flr(rnd(14)) + 34

 elseif (p.y >= 16 and p.y <= 32 and p.x == 112) or (p.x >= 96 and p.x <= 111 and p.y == 32) then
  p.x = flr(rnd(14)) + 113
  p.y = flr(rnd(14)) + 34

 elseif (p.y >= 32 and p.y <= 63 and p.x == 96) or (p.x >= 96 and p.x <= 111 and p.y == 63) then
  p.x = flr(rnd(14)) + 113
  p.y = flr(rnd(14)) + 17

 elseif (p.y >= 2 and p.y <= 13 and p.x == 31) then
  p.x = flr(rnd(12)) + 65
  p.y = flr(rnd(12)) + 1

 elseif p.x == 79 and p.y == 60 then
  p.x = 17
  p.y = 37

 elseif p.x == 16 and p.y == 37 then
  p.x = 78
  p.y = 60

 elseif p.x == 35 and p.y == 15 then
  p.x = 89
  p.y = 49

 elseif p.x == 89 and p.y == 48 then
  p.x = 35
  p.y = 14

 elseif p.x == 40 and p.y == 0 then
  p.x = 99
  p.y = 30

 elseif p.x == 99 and p.y == 31 then
  p.x = 40
  p.y = 1

 elseif p.x == 6 and p.y == 63 then
  p.x = 107
  p.y = 17

 elseif p.x == 107 and p.y == 16 then
  p.x = 6
  p.y = 62

 elseif p.x == 92 and p.y == 31 then
  p.x = 19
  p.y = 30

 elseif p.x == 19 and p.y == 31 then
  p.x = 92
  p.y = 32

 elseif p.x == 0 and p.y == 10 then
  p.x = 110
  p.y = 22

 elseif p.x == 111 and p.y == 22 then
  p.x = 1
  p.y = 10

 elseif p.x == 16 and p.y == 28 then
  p.x = 110
  p.y = 25

 elseif p.x == 111 and p.y == 25 then
  p.x = 17
  p.y = 28

 elseif p.x == 56 and p.y == 0 then
  p.x = 40
  p.y = 42

 elseif p.x == 79 and p.y == 41 then
  p.x = 1
  p.y = 38

 elseif p.x == 0 and p.y == 38 then
  p.x = 78
  p.y = 41

 elseif p.x == 47 and p.y == 17 then
  p.x = 1
  p.y = 56

 elseif p.x == 0 and p.y == 56 then
  p.x = 46
  p.y = 17

 elseif p.x == 41 and p.y == 31 then
  p.x = 39
  p.y = 49

 elseif p.x == 39 and p.y == 31 then
  p.x = 88
  p.y = 1

 elseif p.x == 38 and p.y == 48 then
  p.x = 40
  p.y = 30

 elseif p.x == 40 and p.y == 48 then
  p.x = 69
  p.y = 46

 elseif p.x == 89 and p.y == 63 then
  p.x = 118
  p.y = 57

 elseif (p.x >= 16 and p.x <= 31 and p.y == 0) or (p.x >= 97 and p.x <= 110 and p.y == 0) then
  p.x = 88
  p.y = 10

  end
 end

 if ending_init==1 then
  if p.x == 0 or p.x == 127 or p.y == 0 or p.y >= 63 then
   p.x = flr(rnd(125)) + 2
   p.y = flr(rnd(61)) + 2
  end
 end

end

The last function switches out certain maptiles with others if some conditions are met. I have a lot of different tables and functions of this kind but for brevity I'll just post two.
Compared to the first two I think they are less awful but I still feel they could be optimized.

trap_table ={109,109,109,79,79,79,79,79,49,50,24,24,25,25,40,40,41,41,96,96,112,112,75,76,91,115,117,117,100,101}

function place_traps()
for a=0,127 do
  for b=0,63 do
    if mget(a, b) == 109 then
      mset(a, b, trap_table[flr(rnd(#trap_table))+1])
    end
  end
end
end

function place_corrupt()
 for a=0,127 do
  for b=0,63 do
   if mget(a,b)==79 or mget(a,b)==5 or mget(a,b)==14 or mget(a,b)==15 or mget(a,b)==46 or mget(a,b)==47 then
    mset(a,b,trap_table[flr(rnd(#trap_table))+1])
   elseif mget(a,b)==17 or mget(a,b)==52 then
    mset(a,b,106)
   elseif mget(a,b)==18 or mget(a,b)==88 then
    mset(a,b,107)
   elseif mget(a,b)==19 then
    mset(a,b,122)
   elseif mget(a,b)==77 then
    mset(a,b,83)
   elseif mget(a,b)==78 then
    mset(a,b,84)
   elseif mget(a,b)==66 then
    mset(a,b,92)
   elseif mget(a,b)==82 then
    mset(a,b,108)
   elseif mget(a,b)==67 or mget(a,b)==68 or mget(a,b)==85 or mget(a,b)==74 or mget(a,b)==98 then
    mset(a,b,122)
   elseif mget(a,b)==56 then
    mset(a,b,93)
   elseif mget(a,b)==12 or mget(a,b)==13 or mget(a,b)==127 then
    mset(a,b,flr(rnd(2))+126)
   elseif
   mget(a,b)==28 or mget(a,b)==29 or mget(a,b)==8 then
    mset(a,b,flr(rnd(2))+7)
   elseif mget(a,b)==53 or mget(a,b)==54 or mget(a,b)==124 then
    mset(a,b,flr(rnd(2))+123)
   end
  end
  end
 end

Sorry for so much text but I thought I'd just post them 1:1 like they are in the game.
Thanks for any help!

P#78580 2020-06-27 17:19 ( Edited 2020-06-27 17:21)
[ :: Read More :: ]

Cart #dobiyamita-1 | 2020-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

So I spent a few hours over the last few days recreating a flash game I found online a while back (http://abagames.sakura.ne.jp/flash/ffs/).

I challenged myself to try to recreate the game without looking at the code the original developer provided. After that I added powerups to add a new spin on the original game.

It's missing sound effects and music, but otherwise I've added music and sfx and the game is basically done.

P#78568 2020-06-27 10:10 ( Edited 2020-06-30 04:55)
[ :: Read More :: ]

Hi! I got pico-8 with the itch bundle a few weeks ago, and this was the first thing I made, it's a little snowboarding game, right now all you can do is try to avoid crashing into things, and there's no consequences when you do, but I think it's pretty cool for a couple of days work.

Cart #snowboard1-0 | 2020-06-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#78556 2020-06-26 21:48 ( Edited 2020-06-26 21:48)
[ :: Read More :: ]

I was wondering what colors were useable for the background and when I went to go look I was sad because darkgreen wasn't useable :| I was wondering if more colors that aren't used for text colors could be background colors! IDK it's not really important but I would love a darkgreen background option.

[EDIT: forgot that the mouse has dark blue when pal swapped img. : o]

P#78552 2020-06-26 19:16 ( Edited 2020-06-26 19:29)
[ :: Read More :: ]

Cart #ultrabreakout_-1 | 2020-06-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

Left and Right arrow keys to move paddle, press Up or mouse key to launch!

Inspired by the 70+ video playlist by Lazy Devs, I'm happy to share with you the results of my first real game project.

Ultra Breakout features 10 levels and multiple control options including mouse and touch. There is a slight point advantage to using the standard controls and a slight point disadvantage to using mouse controls.

I hope you enjoy the quick diversion and checkout the original project here. Good luck breaking your personal highscores!

P#78548 2020-06-26 17:51 ( Edited 2020-06-26 19:43)
[ :: Read More :: ]

Hi everyone, I'm fairly new to programming and Pico8.

I'm trying to add powerups to one of my games. I've made an empty table and a function to create each powerup within it.
The problem I'm having is that I'd like one single random powerup to be created depending on the score (say when score==5)

I've managed to do this but the problem was that a second powerup gets created before the player has the chance to up the score.
I've tried to use time() and also creating a boolean but I haven't managed to get 1 single powerup on screen at a time, I either get more than one or nothing.

What would be the best way to do this?

here's the code I have at the moment:

function _init()
    score=0
        powerups={}
end

function _update()
        if score==5 then
        powerup=true
    end

    if powerup==true then
        create_powerup()    
    end
end

function _draw()
         for capsule in all(powerups) do
        spr(capsule.sp,capsule.x,capsule.y)
    end
end

--powerups

powerups_start=5
total_powerups=4
fall=1

function create_powerup()   
    capsule={
    sp=powerups_start+flr(rnd(total_powerups)),
    x=flr(rnd(100)+20),
    y=flr(rnd(10))+20
    }
    add(powerups,capsule)

    powerup=false

    if powerup==false then
        del(powerups,capsule)
    end                         
end

function update_powerup()
    for capsule in all(powerups) do
        capsule.y+=fall

        if capsule.x>=player.x and
                    capsule.x<=player.x+player.w and
                    capsule.y==player.y-player.h then
                        sfx(2)
                     lives.left+=1
                     del(powerups,capsule)
        end 

        if capsule.y>128 then
            del(powerups,capsule)
        end 
    end
end 

Thanks in advance!

P#78545 2020-06-26 17:08
[ :: Read More :: ]

Cart #simple_circuits-0 | 2020-06-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

A simple game about fixing very simple circuitry.

Hopefully it should be fairly self explainitory but you might have to do a little thinking for yourself.

Made in two weeks, a twofold task to myself - get it done in time (I originally intended 1 week but that was unrealistic) and actually finish something! :P

This is my first published PICO-8 cart but by no means my first attempt.
I am not really an artist and definitely not a musician so appologies if these are not the best. (You can mute just the music from the pause menu)

I really enjoyed the process of making this and thought I would share it. It is in a finished state but it may need some difficulty tweaking at some point.

I would like to give credit to:

  • nerdyteachers.com for showing me how to do screen shake. Found here
  • pixelbytes for the thick print code. Found here

I know I could have figured these things out by myself but it was nice that there were examples there when I searched for them.

Thank you to:

  • Zep - for the PICO-8
  • The community - for being an inspiration
  • Everyone who has been patient with my crazy ideas and overly ambitious (and unfinished) projects

Enjoy!

P#78542 2020-06-26 16:18 ( Edited 2020-06-26 16:57)
[ :: Read More :: ]

Cart #jufohibzu-2 | 2020-06-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

This is a basic, and not very efficient benchmarking/profiling cart.

It can handle simple nesting and repeated calls for a given label, averaging the results.

Usage

Begin and end profiling:

bm("Label")
-- code
bm()

Call at the beginning of update to clear stored data:

bm:reset()

Enable or disable benchmarking:

bm:toggle()

Show benchmarking results when enabled:

bm:draw()
P#78528 2020-06-26 05:28 ( Edited 2020-06-26 20:39)
[ :: Read More :: ]

As stated in the title, you can now use up to 32 colors at the same time in pico-8 now.

The feature was revealed by Zep in this thread: https://www.lexaloffle.com/bbs/?tid=38555

This makes all the suggestions I gave in that thread possible and more.

You can't simply use all colors all over the screen though. You have 2 screen palettes and you basically have to select which palette you will use on each drawn line on the screen. In the gif above, the screen is divided into 2 halves, each with its own palette.

Palette Scanlines

Here is the code I used for both screen palettes:

--regular screen palette
pal((
{
[0]=128+9,9,1,128+12,
13,12,6,7,
8+(curr_shield==6 and 128 or 0),2,128+10,128+11,
128+15,10,4,15}),1)

--values 0x10 and 0x30 to 0x3f change the effect
 poke(0x5f5f,0x10)
--new colors on the affected line
 pal({[0]=2,0x8d,1,0x81,0x8d,0x8c,0x86,0x87,0x88,0x81,3,0x83,0x86,0x8a,0x82,0x87},2)
--0x5f70 to 0x5f7f are the 16 sections of the screen
--0xff is the bitfield of which of the 16 line of the section are affected
 memset(0x5f79,0xff,7)

The first pal() is to set the game's screen palette. Nothing new here.

poke(0x5f2c,0x40) enables the 2nd palette. This is the same address that changes screen modes (rotated, stretched, mirrored). You can add these effects as usual, so 0xc5 (0x40+133) will rotate the screen and enable the 2nd palette. See the wiki for all effects. This poke is no longer needed after update 0.2.1.

Pal([table],2) changes the secondary palette. The second parameter defines the target palette (0 for draw, 1 for display, 2 for secondary). You can change colors individually with pal(c1,c2,2) as usual too. You can also access it by peeking/poking addresses 0x5f60 to 0x5f6f.

The memset at the end is a bit more complicated: each address from 0x5f70 to 0x5f7f is a section of the screen. 0x5f70 is the first 8 lines, 0x5f71 is the next 8, etc, all the way to the bottom, 0x5f7f. The value you insert in the address is a bitfield for the 8 lines of that section. 0b1 will affect the first line, 0b11 will affect the first two lines, 0b1010101 will intercalate the lines between the two palettes, and 0b11111111 (or 0xff) will change all lines in the section.

With this, you can select either palette for all lines on the screen. But what if you want to use columns instead of horizontal lines? poke(0x5f2c,133) will rotate the screen, so if you rotate the sprites back to compensate for the screen rotation you can have something like this:

Each character has its own palette!

CRT effect, using the same principles! memset(0x5f70,0xaa,16) alternates lines!

In Moonrace I used the second palette for the mugshots! This might be the first game to use all 32 colors..? :)

Gradient Fill

If you poke(0x5f5f,n) with values between 0x30 and 0x3f, you'll have a different effect. The color corresponding to the last digit of the address will be swapped for a gradient of colors. Each of the 16 sections will be swapped for a different color (pokes 0x5f60 to 0x5f6f). An example will make it clearer:

Here the black background of the game was swapped for a gradient of the 16 basic colors, using the code below:

poke(0x5f5f,0x30)
for i=0,15 do
 poke(0x5f60+i,i)
end

So what does the 0x5f70 address do in this mode? Now each bit determines if that particular line will use the corresponding 0x5f6n color or 0x5f6n+1. Adding the code below will produce the following effect:

memset(0x5f70,0xaa,16)

This might seem a bit unimpressive at first, but remember that you are free to use any of the 32 colors in this gradient, not only the ones you're using currently on the screen. This can be used to add colors to a platformer background or background effects in a shmup for instance. Here is a quick example:

If you look closely the game uses all 15 colors in the foreground and UI except for color #12 (light blue). The light blue is used for the gradient, using the regular colors 0, 1, 12, 6, and 7 and also 0x81 and 0x8c from the alternate palette (18 total colors). Here's another example using 21 colors:

Here is the code for this gradient. Just swap the colors for whatever you like :)

--swap 0x30 for 0x3n where n is the color that will be swapped for the gradient
poke(0x5f5f,0x30)
--put the gradient colors in the table below:
pal({[0]=0x82,0x82,0x84,0x84,4,4,0x89,0x89,0x8e,0x8e,0x8f,0x8f,15,15,0x87,0x87},2)
--blend lines
memset(0x5f70,0xaa,16)

You can use the gradient fill to add an extra color for some objects like in this example. Just be sure they never are on the same line. In this case, the camera never moves in the y axis, so there's no way they will overlap.

That's all I have for now. Have fun!

P#78518 2020-06-25 22:17 ( Edited 2021-11-23 13:16)
[ :: Read More :: ]

Mayhem is my PICO-8 remake of Julian Gollop's 1985 masterpiece: Chaos Battle of Wizards. It is a game I have tried and failed to make many times, but it looks like maybe this time was the charm! I did not blindly remake the original game. Instead, I have taken heavy inspiration from it while trying to make it my own.

This is the first fully playable beta release (v1.0.0b1). Unfortunately, I ran out of tokens for adding AI players, but you should be able to have some hot-seat fun with a friend or three.

Cart #mayhem-7 | 2020-08-22 | Code ▽ | Embed ▽ | No License
3

Changes:

  • 2020/08/22 (v1.0.0b1):
    • First completely playable version of the game.
    • Hot seat only (I ran out of tokens to do AI as well).
  • 2020/07/27:
    • Walking & flying movement.
    • Primitive combat (attacker always wins for now for easy testing).
    • Winner screen.
    • Iterated a few times on selection and movement look & feel.
  • 2020/07/17:
    • Initial work on the main game - turn structure outlined.
  • 2020/07/14:
    • Added Balrog
    • Added Imp
    • Tweaks for Pegasus and Wraith
  • 2020/07/11:
    • Added title screen with logo text.
    • Added bestiary mode to test sprite identifiability.
    • Changed initial mode into the showcase, showing all sprites for one player.
    • Some small sprite tweaks based on feedback.
  • 2020/07/10:
    • Good tree
    • Evil tree
    • Neutral tree
    • Dark tower
    • Fortress
    • Gooey blob
  • 2020/07/09:
    • Crocodile
    • Gorilla
    • Lion
    • Zombie
    • Wraith
    • Ghost
    • Vampire
    • Horse
    • Pegasus
    • Unicorn
    • Dragon
P#78516 2020-06-25 21:30 ( Edited 2020-08-22 19:55)
[ :: Read More :: ]

[0x0]

I'm working on a new game and trying some nice advance platform techniques, currently it has support for.

I don't think the codes is good enough to make it work on any game but maybe it helps someone :) would also love some feedback if someone has any.

🐸🐸🐸🐸🐸🐸

You can toggle the debug info with X

Cart #frogtris-0 | 2020-06-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

General resources dump

Full Celeste Twitter thread
AABB + Swept collisions on GBC
Kyle Pulver nudge Assistance
Kyle Pulver coyote jumping
Rodrigo Monteiro The Guide to implementing 2D platformers
Sonic collisions
Yoann Pignole Platformer controls
Advance Platform movemnt
Jumping Graphs For Platformer Games
N++ Collision Detection and Response
Why Does Celeste Feel So Good to Play? | Game Maker's Toolkit

Pico8 Specific resources

Nerdy Teachers Platformer setup
Advanced Micro Platformer - Starter Kit

P#78512 2020-06-25 19:38 ( Edited 2020-07-10 23:00)
[ :: Read More :: ]

Cart #dancedance-4 | 2020-06-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

First coding I did using PICO-8 trying to get used to it

and I made a character edit/select screen, lets you change colour of clothes/skin

P#78510 2020-06-25 19:32 ( Edited 2020-06-25 20:13)
[ :: Read More :: ]

Hello! I am setting up a Pico 8 Console in my shed, but can't get the screen scaling just right. This is running on a raspberry pi, and otherwise seems to work great.

However, Pico 8 runs either much too small, or just a fraction too big.

These are the settings I am using in config.txt.

Is anyone able to help?

// :: Video Settings

window_size 768 576 // window width, height
screen_size 768 576 // screen width, height (stretched to window) 
pixel_perfect 0

// :: Window Settings

windowed 1 // 1 to start up in windowed mode
window_position -1 -1 // x and y position of window (-1, -1 to let the window manager decide)
frameless 1 // 1 to use a window with no frame
fullscreen_method 0 // 0 maximized window (linux)  1 borderless desktop-sized window  2 fullscreen
P#78497 2020-06-25 12:21
[ :: Read More :: ]

Hello.

I am running Pico-8 using this bat file, so that it stays portable, and all files, settings and carts are kept in one folder (I really don't like how Pico-8 puts stuff in a random folder that Windows people usually never use).

start pico8.exe -music_volume 0 -home . -root_path . -desktop_path . %*

I also changed -music_volume to 0 in the config.txt file.

However, every time I run Pico-8, the setting in the config file gets reverted back to 256 and the music volume always stays on.

Also, every time I run Pico-8, I maximize the window (not full screen), but the next time I run it, it always starts as a small window, not a maximized window.

What am I doing wrong?

P#78489 2020-06-25 10:44
[ :: Read More :: ]

Hi

I found a Pico-8 cart on Itchio (https://bati.itch.io/super-pico-fighter) and I want to take a look at the code to see how the block matching logic works.

Unfortunately I wasn't able to see a download link and I couldn't find it listed here in the Lexaloffle BBS.

Is there a way I can download it so I can learn from it?

Thank you.

P#78488 2020-06-25 09:58
[ :: Read More :: ]

The first paragraphs are just some opening thoughts to contextualize where I'm coming from with this idea. If you are not interested in that, skip to [Suggestion].

Context

When the 2nd palette was first discovered, increasing the total number of colors on the screen has been suggested a number of times. That in itself is a pretty weak idea: bumping up pico-8's limitations is against its whole purpose of self-imposed limitations. If you want more colors, just use any other platform. End of story.

But recently, with the 0.2.0x versions, a lot of new features have been added that expand what pico-8 is capable of: better code compression, tline, the upcoming oval(), new chars (kana, puny). Tline in particular changes the whole feel of the carts that use it, with the possibility of mode7, rotation, map lighting, etc. While those effects were previously possible, the games that had them would pay a high cost in CPU and tokens.

Ever since the 2nd palette came, I had some ideas of how the color limit could be increased without going against pico-8's design principles. From these ideas, I selected my favorite and arguably the one that fits pico-8 the best. With pico-8 going beta and possibly its core being set, this might be my last opportunity of sharing it, so here it is:

Suggestion

  • Change the [p] parameter in pal(tbl,[p]) to a integer value between 0 and 128. The [p] value is the first scanline that uses the new palette;

  • This would effectively increase the possible uses of the function from 2 (draw palette and screen palette) to 3 (draw palette, screen palette, and mid-screen palette);

  • If [p] is 0, you change the draw palette as usual. Likewise if [p] is 1, the first line is changed to the new palette, all the way to the last line. No changes here. If [p] is above 1 it means the first scanline of this palette is not at the top of the screen, so it will change the screen palette from that line onwards;

  • Using [p>1] more than once per flip will replace the last mid-screen palette. In the code below, only the [64] value would take effect:
function _draw()
 pal({129,130,131},32) --changes the mid-screen palette for y>=32

 pal({132,2,0},64) --overwrites the pal() above so only this one takes effect when the screen is drawn
end

Uses

In alignment with pico-8's philosophy, this would allow new things to be done, but also create new challenges to overcome and breed creativity through its limitations. Here are some examples:

Water palette

Pal-swap the lower half for some water effects, like in some 16-bit games. It could also be used for water reflection.

Split-Screen

In a game with split-screen, changing the screen palette would affect the other player's half-screen. This new feature would prevent that.

Fighting game character select/VS screen

Poke(0x5f2c,0x85) rotates the screen, so instead of top/down palettes, it's left/right. With that, you can have nice 15-color palettes for each character in a VS screen, with the black background hiding the transition between palettes. More juice could be added to each side with their respective palettes (character's names, country flags or whatever else).

UI

Kind of a crude example, since this game was not intended for that, but you could have some different colors for UI if it has a more clear separation from the game area, like it's common in RTSs and some point-and-click games (the red arrow indicates the transition line).

Custom Tools

In my custom tool, Painto-8, the entire screen changes when you open the palette selection. This feature could help to circumvent that, making it less jarring.

Mode 7

In games that use mode7-like effects, you can have 1 palette above the horizon (for the sky and UI) and another below (ground, characters and objects).

Anyways, you get the idea. It really creates a new layer of cool things to explore while mostly keeping the same restrictions. I think it fits pico-8 well... Who knows :)

P#78471 2020-06-24 23:45
[ :: Read More :: ]

hi!

how do i setup a permanent storage?

0.2.0i_windows, fresh install from itch.io, "install_demos" just quits PICO-8 completely. plus there is no pico-8 related stuff in "AppData/Roaming" (could it be because of the cyrillic windows username?)

thanks,
Dima

P#78470 2020-06-24 19:30
[ :: Read More :: ]

A few days ago someone on my discord server asked me how to configure keys in an exported cart and I didn't figure out how to do it, nor did I find any information about it anywhere...

So I assume there's no way to do it right now...?

Just letting the player access the Keyconfig screen from the controls screen would be great.

And saving the config after each session :)

I think it's something that can easily affect user reviews in external sites, Itch.io, Kongregate, and so on, and also help with accessibility.

P#78469 2020-06-24 18:20
[ :: Read More :: ]

LAST VERSION as USED in R-type 1.4 after optimizing it a bit further:

--97 tokens with Scaling and arbitrary size
function pd_rotate(x,y,rot,mx,my,w,flip,scale)
  scale=scale or 1
  w*=scale*4

  local cs, ss = cos(rot)*.125/scale,sin(rot)*.125/scale
  local sx, sy = mx+cs*-w, my+ss*-w
  local hx = flip and -w or w

  local halfw = -w
  for py=y-w, y+w do
    tline(x-hx, py, x+hx, py, sx-ss*halfw, sy+cs*halfw, cs, ss)
    halfw+=1
  end
end

This is a general-purpose sprite rotation function using tline with support for scaling and flipping

Cart #tline_sprite_rotation-5 | 2022-04-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
48

It always draw a screen-oriented rectangular area, (centered at x,y) large enough (w) to contain the rotated tiles (centered at mx,my), and calculates the rotated (rot 0 to 1) tline coordinates and deltas.

The catch is that you need to have the sprite in the map and must leave "clearance-space" around the map part to be rotated (matching the largest side of the sprite or you get some additional map tiles drawn as well, visible in pink in the example). But you can just prepare one rotating area and just swap tiles with mset().

LAST EDITED for a mistake that was messing up mx and my

P#78451 2020-06-24 05:59 ( Edited 2022-04-30 06:52)
View Older Posts