Log In  
Follow
dw817

Just another mad coder.

We're all mad. I'm mad. You're mad, you must be - or you wouldn't have come here.

Find my books and biographical works HERE:
http://www.writerscafe.org/dw817

SHOW MORE

Hello there.

Not all of us are great programmers. Yet we all have our own unique gifts.

What with the large number of tornadoes we've had recently I thought it might be interesting to make a game regarding these.

Clearly nothing is tastier to a rampant and wild tornado than an abandoned mobile home so the game idea I have in mind is, you must sate the appetite of oncoming tornadoes, to make sure they don't cross a certainly line or into a territory, by hurling mobile homes into them.

These homes are empty and designed specifically to slow down tornadoes. I haven't seen a game like this yet and thought it might be interesting to do - especially with the pull of a tornado, like gravity, and hurling heavy metal rectangles like mobile homes that are affected not only by gravity, by how heavy they are, but also by the pull of the tornado.

And it is possible to toss a mobile home into a tornado and have it "bounce off" because it was not thrown at it the correct angle and velocity.

I leave this game idea for our more adept programmers who specialize in 3D objects and physics. :)

. . .

And this thread could be for other game programmers such as myself - who have ideas for games that have not yet been written and pass on the mantle to other eager programmers who may lack on great game ideas but exceed well in the field of programming and/or graphics and music.

What videogame would you like to see ?
Can you describe it ?
What is the game about ?
Is there a story or plot attached to it ?
What would a single level of gameplay detail ?
What graphics and sound would it use ?

P#126560 2023-03-03 18:52 ( Edited 2023-03-03 18:57)

SHOW MORE

Cart #driftsnow-1 | 2023-02-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
11
(v01 02-26-23)
TO LOAD THIS PICO-8 CART, in immediate mode, type: load #driftsnow


Hello.

While some years back I did write a fairly complex cart to draw snowflakes on the screen, they were not incremental. That is they stayed the same number on the screen at all times.

I was noticing in the BSNES emulator they do this instead. They add one snowflake per second on the screen-saver. The effect I think is rather pretty - so here is my version of it for Pico-8.

The code is documented quite thoroughly.


Be aware of some numbers you can fiddle with that are defined at the top of the code:

LONG=30 this determines how many frames pass by before a new snowflake is added. Since the default is 30 it means one new snowflake will appear every second. Or after 33-minutes, there will be over 2,000 snowflakes moving on the screen. Try LONG=15 to see 2-snowflakes added every second.

COLR={5,6,7} this tells what colors the snowflakes will draw for that instance. As it is 3-different colors here, when a snowflake is plotted it will choose one of those numbers at random to give a nice flicker to the snowflake. Try COLOR={7} to have the snowflakes drawn using only the color white.

SPED=1 this is the maximum speed the snowflakes can go. By defaulting to 1 they move a nice comfortable speed. Change this to SPED=2 for instance to have them move twice as fast.

COUN=0 this forces snowflakes to appear. For instance if you wanted to start the cart and have 100 snowflakes appear all at once without waiting for the timer, change this value to 100 with COUN=100


During execution, press any key to see the number of snowflakes and the amount of CPU being used.

And that's it !

If you liked what I did here or have any questions or comments about it, please let me know.

THANKS !

P#126328 2023-02-26 21:31

SHOW MORE

Cart #bejuyasero-0 | 2023-02-25 | Code ▽ | Embed ▽ | No License
2

Hello.

I have noticed this sample program I wrote does not play 2-notes blending, one after another. No, it cuts off the first one and then plays the new one - despite being on an entirely different channel.

@zep, I think this qualifies as an error. Could you fix it, please ?

P#126291 2023-02-25 21:50

SHOW MORE

Cart #pvader-2 | 2023-02-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9
(v02 02-22-23)
TO LOAD THIS PICO-8 CART, in immediate mode, type: load #pvader


VVHAT'S NEW ?

(02-24-23)

  • The player now appears in the middle after you lose a tank, just like when you start the game.

  • Because of the incredibly high scores, I have tweaked the speed of the invader slightly to be faster over time.

  • Also because of the high scores I am seeing, I am setting it so the flying saucer makes one pass. Once it goes off the edge of the screen to the left, it will not reappear until you make another +100 score. So now it's vital you shoot it when it appears. If you somehow miss it, it will appear again once you get your score +100 again.

  • I added a new fire-element, filled oval which you can see when you shoot the flying saucer. So the elements are now:
  (Add Fire Element)  
  function addfireelem(Element,x1,y1,(x2/Radius),y2)

  Element=
  0 = Dot       (x1,y1)
  1 = Line      (x1,y1,x2,y2)
  2 = Rectangle (x1,y1,x2,y2)
  3 = Circle    (x1,y1,Radius)
  4 = Oval      (x1,y1,x2,y2)

  Call function fireball() when ready.
  • There is about a second or so delay when the game ends so you do not suddenly return to the menu without having had a chance to see your final score.

Hello.

It was believed a cart I wrote years ago to turn every pixel on the screen into a flammable point could not be used to develop a game. To see that original cart, go HERE:

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

The Arcade Stars comes from HERE:

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


Well, that is what this is. I started to write this on 02-16-23 and finished 02-22-23. Proof that a game can in fact be developed using my method which scrolls stars on the screen, independently controls and draws sprites, and ignites every marked pixel on the screen. To do so I am taking advantage of extended memory and page-swapping really 3-pages altogether.

The first layer is the stars. The next is the game screen where the sprites are drawn. And the third is the screen where marked pixels combust - all operating independently of each other.


This code is proof that all 3 can be combined. It is also highly documented throughout as you can see above.


The original game is based upon an old Intellivision cartridge called "K-Vader" and the premise is the same except I don't think it uses the same scoring methods. I wanted to write my own and try to make it more challenging besides.


okay so the scoring method I chose is the following:

First off there are =2= different targets, the space invader and the flying saucer.

[16x8]

The saucer will not appear except once every 100 points. so when the saucer appears it will appear so long as your score is at or over 100 points.

Every time you shoot the flying saucer you get a free tank but NO CHANGE to your score. This is not so easy to do on more difficult levels as you may be overrun by the invader while attempting to shoot the slow-moving saucer, and it never changes in speed which can be an advantage to begin with and a challenge to hit it later on.

Once you shoot it though, the next score target is 100+ that so it would be 200-points, and so on.

The invader itself starts out moving slowly enough you can peg it with your laser cannon, however every time you shoot it, a new one appears at the top and travels even faster.

The scoring is simple. shoot the invader and get 10 points plus your current level. Once your score is added, then the level increases by one - also increasing the speed of the invader.

For every time the invader descends, you =lose= 1 point.

The invader level starts out as zero and goes up one point each time you successfully shoot and destroy the invader.

You start with one tank and two spare ones. A total of three.

And yes this is the only attack the invader has, is to overrun your tank.

If you are overrun, however, you will lose one of your tanks in stock and the invader will be stepped down 2-levels of speed to compensate.

Seizure warning: Be aware there is .5 seconds of flashing red when you lost a tank.

If you do lose all your stock of tanks including the one you are navigating, it is game over.
Press 🅾️ to restart the game which will recall your high-score.


Your score is recorded using the cartdata() method so even if you shut this game down and come back to it later, it will always remember your best score listed as hi-score.

To erase your hi-score, at the main menu hold down the ❎ key until the red-line crosses entirely from the left to the right. then your hi-score will have been reset to zero.

S E C R E T S T O B E S T P L A Y
UPDATED: 02-24-23


[16x8]

There are many methods to racking up a high score in this game.
.
If you wait for the invader to drop down to the level of your tank, while in early missions it is not so difficult to shoot your target, in later it is. And you are penalized 1-point of your score every time you allow the invader to descend a row, and that might make it difficult for you to get the saucer which only appears when your score has reached 100, 200, 300, etc. points.
.
Try to get in the habit of shooting the first run of invaders before they can descend at all. And if they do, develop a pattern for catching them on the next row. Nothing is more frustrating than firing and missing every time. Practice practice makes perfect.
.
One method is to get on the far left or right side and then you have more time to shoot the invader as you will have twice the chance to hit it as it crosses from the left into your sights and then the right - and vice-versa.
.
As for the flying saucer, once it appears it is vital you shoot it. Give it top priority. But also be careful. Look around at your position. Are you going to be overrun in the next second ? Then ignore it and focus on shooting down the invader.
.
Only shoot the flying saucer when you know you have plenty of time - because it takes time for your shot to leave your tank and travel all the way to the top, and if you miss, you wasted that much time and you could lose the bonus tank by not hitting the saucer.
.
However if you have no tanks in spare and you are about to be overrun, you have to make a critical decision, can you shoot the saucer in time to gain a bonus tank or should you ignore it and try to hit the fast-moving invader instead ?
.
It's up to you to develop your own techniques as for getting a high score - and then challenge yourself to beat that !

My best score is 523. Can you top that ?

Good luck !


As always if you like what I did here, you found a bug, have some suggestions to make the game more challenging, or have any questions about the two primary functions I provided here to use in your own code, please let me know !

If you post your score, please post a video showing how you got this. To do so, load the game in purchased Pico-8 to execute in offline mode. Run it. Press F8 to start to record video. Play the game. When your score is high enough, press F9 to end the recording of the video. Post your score and video here for all to see. Upload video (*.gif) as picture in your post, and there you have it. :)

THANKS !

P#126167 2023-02-22 20:14 ( Edited 2023-02-24 19:06)

SHOW MORE

Hello.

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

I was wanting to look at some sprites I posted some years back and found they had been replaced by later sprites I did, meaning I think the buffer overflowed. Is it possible I have uploaded more than 1,000 images and it went from 999 to 0 ? That is what I think is happening here.

Nonetheless this is a problem.

@zep could you please look into this and see if the images I posted years ago are now lost because they were overwritten by a counter ID ?

Thank you !

P#125963 2023-02-16 18:05 ( Edited 2023-02-16 22:20)

SHOW MORE

Cart #morethan32notes-0 | 2023-02-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7
(v00 02-15-23)
TO LOAD THIS PICO-8 CART, in immediate mode, type: load #morethan32notes

Hello.

If you have experimented with sound effects in Pico-8, you will be aware that you are limited to 32-notes per sound effect. So how can you get more ?

Well if you are not yet familiar with it, you can click this button HERE and then the instrument for this SFX will actually use a SFX from 0 (zero) to 7. You can see this when you type 0-7 for your instrument, it will appear in GREEN instead of the default PINK.

So this music is an example of a single SFX where 6 of the notes are played twice instead of once and by making that pattern an instrument, it frees up the space required to actually store two-notes at a time for that single SFX.

And you can also create custom instruments for your music as well this way.

If you found this helpful or have any questions, please let me know.

THANKS !

P#125919 2023-02-16 01:29 ( Edited 2023-02-16 01:42)

SHOW MORE

Hello.

One cart I made called, "Most Creepy Acid Effect" does not appear when I click my alias, then click on Cartridges, then click on either Releases or All.

https://www.lexaloffle.com/bbs/?uid=15232&mode=carts&sub=0#m

It seems like all of my other carts are appearing - except for the "Most Creepy" one.

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

It is not a work in progress or Jam - it is listed as "CARTRIDGES" - so it should appear there and does not.

@zep please let me know what can be done here to remedy this situation.

P#125905 2023-02-15 19:03 ( Edited 2023-02-16 18:05)

SHOW MORE

This is for @huulong but will likely assist others.

There was some talk of not being able to export the LABEL of a Pico-8 cart.

That is the screen you record when you press the F7 key during its runtime.

Well it can be done with a bit of work.

These instructions are for the commercial version of Pico-8.

Load the cart you want to export the title screen and type the following in immmediate mode:

save flip

Then edit the FLIP.p8 in Notepad or some other convenient text editor.

Look for __gfx__ change that to __label__

Look lower in the code for __label__ change that to __gfx__

Save that code.

Bring back up Pico-8.

Now in immediate mode type:

load flip

You will see that the spritesheet now contains the title screen.

To export the title screen type:

export title.png

When all done you can delete the flip.png file.

If you found this helpful or have further questions, please let me know.

THANKS !

P#125598 2023-02-09 18:32 ( Edited 2023-02-09 18:33)

SHOW MORE

In order to expand Pico-8's scope of influence and interest, I was wondering if it was possible to compile a Pico-8 cartridge to a new kind of EXE. Not one that requires Windows as it can now but runs perfectly well in DOSBOX ?

https://en.wikipedia.org/wiki/DOSBox

Is this possible ?

P#125442 2023-02-06 23:19

SHOW MORE

[128x128]

Hello.

One of the limitations of Pico-8's educational edition is that you cannot import or export sprites. So - making use and only making use of the system itself, I show how you can actually do so.

First off, if you do not have Pico-8 yet, you can either purchase it HERE:

https://www.lexaloffle.com/pico-8.php

Or get more information and make full use of the educational edition, HERE:

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

Now the primary restriction to the educational edition is the lack of SPLORE, which is well-worth the cost of the system ($15) in all cases. You just boot up Pico-8. Type out SPLORE followed by the ENTER key and you have a wonderful frontend for all the gaming carts written in Pico-8 - sorted by popularity, how new they are, and you can search for carts by key words and names such as "star trek."

The other is using the IMPORT and EXPORT command, also disabled. Yet importing and exporting sprites for the educational edition of Pico-8 is the focus of this topic - it can be done after all - and it does not require outside code.

To load any Pico-8 cart in the educational edition from the website Lexaloffle, type in immediate mode, load # include that pound sign, and the name of it, for instance, see the frame here:

Notice to where the arrow is pointing. Here is an enlargement of that area:

So the name of this cart is "dialog." Do not include the minus "-" or any text after that.

To load this in the educational edition of Pico-8, type in immediate mode, load #dialog followed by ENTER.

And now you have some sprites to experiment with !

Either use this cart or any cart that has sprites you'd like to test - to see how to save off as a PNG file.

To save off these sprites to a PNG file, remove the code. You can do this in the code editor by pressing CTRL+A and the BACKSPACE key. Then type the following:

memcpy(24576,0,8192)
extcmd"screen"

Run this with CTRL+R.

This will create a saved image as seen as a small square to the right of your programming frame. In there, RIGHT-CLICK your MOUSE and choose "Save image as ..." to save off this spritesheet as a 128x128 pixeled PNG file.

To recover the original source code, back in the code editor press CTRL+Z until the original code reappears highlighted, then press any arrow key to remove the highlight and the code is back.

Be aware there is no easy way to IMPORT a PNG file to Pico-8 educational edition, yet you can transfer graphics between these carts, read on.

You should also know that you can have more than one educational Pico-8 frame open at a time yet they DO NOT share files. You can see this by working in one frame, type in immediate mode either DIR or LS followed by ENTER and see the files you work on do not appear in both frames.

So always save your files to your HD, you can easily do this by typing in immediate mode: save test or whatever filename you want, folowed by the ENTER key.

To load a file you have saved on your hard-drive, type out: load withou anything else followed by the ENTER key and a filebox will come up letting you load that cart from your hard-drive.

Now to transfer graphics between one cart and the next, first off click in the red bar above the icon that looks a little like a demon.

You will get this screen:

Press CTRL+G to add grid and there you go. Here is where all your graphics go. I'll draw a few and return. Draw some yourself if you like.

[32x8]

OK we have 4-sprites. To transfer these to another Pico-8 educational edition tab that is open, to start left-click on the first sprite, the "1" Now holding down the SHIFT KEY drag the mouse to the right until all 4 are highlighted, then release the shift key. It should look like this:

Still maintaining the highlight on these 4-sprites. Press CTRL+C to copy that to the clipboard.

Now go to your OTHER Pico-8 educational edition frame, go to the spritesheet where you want to paste these 4-sprites, IE here:

Now right where the cursor is, press CTRL+V. You will see your 4-sprites posted.

Use this method to save your sprites from one Pico-8 educational edition cartridge to another.

Now if you want to post some sprites in Lexaloffle, still having your clipboard with those 4-images, you can anywhere in your message also press CTRL+V. It will appear as such:

[gf×]20080000000000000000000000000000000000888000099999900aaaaaa00bb00000000880000900099000000
aa00bb00bb00008800000000990000aaaa00bb00bb0000880000999999000000aa00bbbbbb000088000099000000a0
00aa000000bb000888800099999900aaaaaa000000bb000000000000000000000000000000000[/gf×]

But when you PREVIEW or POST, it will appear as such:

[32x8]

If you want to save these graphics for later, you can also save them in NOTEPAD or really any normal text editor. Just paste them and maybe put a label above what the sprite is supposed to be.

When you are ready to use this image in your code, highlight all of it minus your notes telling you what it is, and in your sprite sheet, press CTRL+V. It will paste the correct image accordingly.

OK !

Now you know how to import and export graphics between the educational edition of Pico-8 ! :)

If you found this helpful or have further questions, please let me know.

Thanks !

P#125315 2023-02-04 19:02 ( Edited 2023-02-04 19:53)

SHOW MORE

Hello.

I am understanding I am not to write a program that allows you to import/export PNG files to and from P8 cartridges, so I wrote this in an attempt to assist other Pico-8 users of the educational edition since they cannot import or export graphics or music.

It uses a variance of the graphics for the little library I wrote, the first Picotron program written found HERE:

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

I exchanged the spider and bomb for Forest (tree) and rubble which can double as mountains. There are some miscellaneous sound effects and I also added a musical note player that overlaps the notes as they play so they sound better.

Cart #p8edulib-1 | 2023-02-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6
(v01 02-04-23)
TO LOAD THIS PICO-8 CART, in immediate mode, type: load #p8edulib

-- educational edition library
-- written by dw817 (02-03-23)

-- standard pico-8 ⌂ license.

-- useful for either the
-- educational edition of
-- pico-8 or the lazy coder
-- in all of us. :)

function _init()

-- clear screen.
 cls()

-- this string contains all 128
-- 8x8 pixeled characters.
-- it includes uppercase
-- letters, lowercase letters,
-- and 32-special gaming
-- characters. they are in no
-- way compressed. if you want
-- compressed, let me know and
-- i will write the code for
-- it.
fontz="0000000000000000000000000000000000000000000000000000000000000000000770000077770005777700055770000055000000077000005500000000000007700770577057705500550000000000000000000000000000000000000000000077077007777777557757700777777755775770055055000000000000000000000770000777770055555770007777000775500055777770055775000055000000000000077007705577577005577500077577005775577055005500000000000000777000077577077577705577757705775577077577705505550000000000000770000057700000557700000550000000000000000000000000000000000000770000055577000005577000005770000077000077500005500000000000000000077000077500007700000577000005577000005557700000550000000000000770007757707757777770577777707757757750577550005500000000000000000000000770000057700007777770555775000057700000550000000000000000000000000000000000000000000000077000005770000055770000055000000000000000000000000000777777775555555000000000000000000000000000000000000000000000000000000000000770000057700000550000000000000770000057770000557770000557770000557770000557700000550000000000007777700775557757707577577575775775057755777770055555000000000000077700005770000057700000577000005770000077770005555000000000000077770007755770577555005557700000555770077777705555550000000000077777705577550005577000077500005770077055777700055550000000000007770000555770000775770057755770577777705775550055000000000000000777777055555770007777700775550057700770557777000555500000000000007770000555770000775770077057705770577055777700055550000000000007777770577555005577000005777700055577000005577000005500000000000777777057755770557777000775577057705770557777000555500000000000007777000775577057705770577077005577500005577700005550000000000000077000005770000055000000000000000770000057700000550000000000000007700000577000005500000007700000577000005570000005570000005000077000005557700000555770000775000775000055000000000000000000000000000000077777705555550007777770555555000000000000000000000000000000077000077500077500005557700000555770000055000000000000000000007777000775577057705500555770000055000000077000005500000000000000077700007550700707750757570757557777570555507000077700005550000000000000777700077550005770770057755770577777005555500000000000000007700077577007705770577057705577577005577770005555000000000000000000007777000555577000005770000057700077770005555000000000000770000057707700577557705770577057705770577777005555500000000000000000000077770007755770577757705550577000777700055550000000000007770000555770000777770055577000005770000057700000557770000555000000000007777700577557705770577057707700577550005577770005555000000007700077777007755770577057705770577057705770550055000000000000077000005500000007770000577000005770000057700000550000000000000077000005500000007770000577000005770000057700000557777000555500000007700770577055775770055777700077577007705770550055000000000000077700005770000057700000577000005770000077700005550000000000000000000000770777077777775775757757750577577005775500055000000000000000000077077007707770577557705770577057705770550055000000000000000000007777000775577057705770577057705577770005555000000000000000000000777770077557705770577055775770055057700000577000005500000000000077777005775577057705770577077005775500077770005555000000000000007707700770777055055770000057700000577000005500000000000000000007770000555770000057700000577000005577700005550000000000000077000077770005557700000577000005770000777000055500000000000000000000077007705770577057705770577757705770770055055000000000000000000007700770557757700557777000557770000557700000550000000000000000000770007757700577577075775777777757775770555055000000000000000000077007705577770005577000007777000775577055005500000000000000000007700770577057705770577057707700577550005577770005555000000000000777777055775570055775000755770057777770555555000000000000777700055577000005770000057700000577000077770005555000000000000000077000007770000777000077700007770000577000005500000000000000007777000577500005770000057700000577000005777700055550000000000000000000000070000007770000775770077055775500055000000000000000000000000000000000000000000000000000000000077777705555550000000000007777000577700005770000057000000500000000000000000000000000000007777000577570005775770057755700577757705770557055000500000000000777777057755770557757700770577057705770557775000555000000000000077777005555577000005770000057700000770007777000555500000000000000077770007757700770577057705770577057705577777005555500000000000777777055555770007757700550577000005770077777005555500000000000077777005555577000775770055057700000577000005770000055000000000000777700055557700000577007775770577057705777770055555000000000000770077057705770577777705775577057705770577057705500550000000000007777000557700000577000005770000057700000777700055550000000000007777000577500005770000057700000577007705577770005555000000000000770077055775770055777700057777000775770077057705500550000000000000007700000577000005770000057700700577057777770555555000000000007700077577707775777777757757577577505775770057755000550000000000770077057707770577777705777577057705770577057705500550000000000007777000775577057705770577057705770577055777700055550000000000000777770077557705770577055775770055057700000577000005500000000000077770007755770577057705577770005577000007777000555500000000000007777700775577057705770550777700077577007705770550055000000000007770000555770000057700000577000005770000055777000055500000000000777777055555500000770000057700000577000005770000055000000000000077007705770577057705770577057705777577057707700550550000000000007770770577057705577577005577770005577700005577000005500000000000777007757700577577005775770757757777777577757705550550000000000077007705577770005577000005770000077770007755770550055000000000007700770577057705770577055777700055770000057700000550000000000000777777055775570055775000055770007055770577777705555550000000000077700005777770057777770577777705777770057775000555000000000000000077000005770000057700000550000000770000057700000577000005500000000777000777770077777705777777055777770055577700005550000000000000000000000777077077577577705505550000000000000000000000000000000077700007550700707770757555757570777575575507005577700005550000aa404aa0a4a4a4a00afffa0057bfb7504f3f3f40a4fff4a00a404a00000000000000000084080480084848008484848087cdc7804f1f1f4004fff40000000000000a0000009a9000aaa7aaa004aaa40009a9a9000a404a0000000000000000000444440099999990444444409a979a909a999a909aaaaa9099999990000000000000000002202200288287202888882002e8820000282000000200000000000000dcd0000c1c1c00d1c1c1d0cc171cc0d1c1c1d00c1c1c0000dcd0000000000009aaa9009a999a90a99a99a0a9aaa9a0a99a99a09a999a9009aaa90000000000022e22002e2d2e20222e2220ede7ede0222e22202e2d2e20022e2200000000011111c7c11c7c1111111111111111111c7c111111111c7c11111111111111111bbbbbbbbb3bbbbabbbabb3bbbbbbbbbbbbbbbbbbbb3bbabbbabbbb3bbbbbbbbb333b3b3333b0b0b33b0b0b0b33b0b0b33b0b4b0b33b343b333334333333343330049909990440499909904409499000994409949099499444994400044099099000000000067776006707076067808760067776000000000000676000000000000044400000999000097079000a007a000977790000999000004440000000000000000000000057500005767000576000676670007070000067600000000000000067600007d0d70006d0d600dd676dd0d67076d0dd707dd0d66666d000000000000000000000000555555007777750077777500666775000067750000677500000000000000000055555555777777777777777766666666000000000000000000000000000000000055555500577777005777770057766600577600005776000067750000677500006775000067750000677500006775000067750000677500000000000000000000000000575757570000000000000000000000000000000000577600005776000057760000577600005776000057760000577600005776000067750000677500666775007777750077777500555555000000000000000000000000000000000066666666777777777777777755555555000000000000000000577600005776000057766600577777005777770055555500000000000000000000000000000000000000000000d000000000000000000000000000000000001111111d0000000100000001000000010000000100000001000000010000000167777770d6666670dddddd6000000000777067776670d666dd60dddd000000000000000006000000065d0000065d5d0006665d5d0776665d0777766600000000044444440400000404000094040095940495959404959594044444440000000006044a4406605554067605540676055406760554006604440006000000000000000000700dddddd000dcccc0000dccc000dcccc00dddddd00000007000000000"

-- draw out all 128-characters
-- so you can see what they
-- look like.
  for i=0,7 do
    for j=0,15 do
      print8(chr(j+i*16+32),j,i)
    end
  end

-- simple text.
-- notice i am swapping upper/
-- lower case so uppercase is
-- printed by default and
-- lowercase is achieved by
-- pressing ctrl+p for puny
-- mode and again to return
-- back to normal typing.
print8("\130 hello world! \130",0,12)

-- play all 8 notes, up an
-- octave, then sharps for
-- them.
music8("[cdefgab]c.cdefgab]c")
music8("[c#d#e#f#g#a#b#]c#.")
music8("c#d#e#f#g#a#b#]c#")

end

-- just loop forever.
function _update()
end

-- custom print 8x8 character
-- from included font stored in
-- global string fontz.
-- t = text to print.
-- use \128 to \159 for special
-- characters.
-- each character is separated
-- by 8-pixels horizontally and
-- 8-pixels vertically.
-- x = x-position (0-15).
-- y = y-position (0-15).
-- 82-tokens or 179-chars.
function print8(t,x,y)local s,a=sub for i=1,#t do a=(ord(s(t,i,i))-32)*64+1for j=0,7do poke4(24576+4*x+512*y+j*64,"0x"..(s(fontz,a,a+3).."."..s(fontz,a+4,a+7)))a+=8end x+=1end end

-- some simple sound effects
-- you may want to have in your
-- carts.

function sfxup()print("\ax1c")end

function sfxdown()print("\ax3c")end

function sfxshot()print("\ax3p5c")end

function sfxhiboom()print("\as~i6x3c5")end

function sfxloboom()print("\as~i6x3c1")end

function sfxwalk()print("\as3i6x3c3.c2")end

function sfxbip()print("\as2i7x5c5")end

function sfxbop()print("\as2i7x5c3")end

function sfxbeep()print("\a")end

-- play musical notes.
-- use a b c d e f g for notes.
-- use [ to decrease octave.
-- use ] to increase octave.
-- use . to skip a note.
-- use # to play sharp note ie:
-- a# b#
-- use - to play flat note ie:
-- a- b-
function music8(t)local s,a,p,c,d=sub,0,3for i=1,#t do c=s(t,i+a,i+a)d=s(t,i+1+a,i+1+a)if d=="#"or d=="-"then c=c..d a+=1end if c=="["then p=max(0,p-1)elseif c=="]"then p=min(5,p+1)else print("\^d9 \as\200i7x5"..c..p,0,0)end if i+a>=#t then break end end end

Users of the educational edition of Pico-8, you can copy this code by clipboard and paste directly in your source-code. It not only has 128-characters and game sprites but a fairly robust library of sound effects and the ability to play notes overlapping each other.

If you found this helpful or have further questions, please let me know.

Thanks !

P#125285 2023-02-04 06:28 ( Edited 2023-02-04 19:54)

SHOW MORE

Hello.

While this could be worked into a Pico-8 cart I wanted to ask first if someone could explain the answer to this question.

The premise is a simple one.

You are in a game show and you are given 3-doors to choose from. Behind two of the doors are goats, which I'm assuming you can't take home as a pet, yet the 3rd has a brand new car in it, your prize for choosing correctly.

And you don't know which item is behind each door.

So let's suppose you choose the first door and as you are reaching for it you are STOPPED by the host who opens the third door revealing a goat. The host then asks you would you like to continue to open the door you chose (the 1st) or would you like to change and choose the 2nd one instead.

The answer we are looking for is what is the chance of choosing the car at this point ?

Initially you have a 1 out of 3 chance of choosing the car.

Yet according to what is considered the most intelligent person in the world, not me, sadly, :) , they said after the 3rd and only the 3rd door is open revealing the goat, that you have a 2 out 3 chance for picking the car.

But I can't see this and neither did many other learned and intelligent people I see only a 50-50 chance of getting that car now just as they did.

Can someone explain to me, use code if you like, how it is possible that you have a 2 out of 3 chance for picking the car if the last door is opened revealing a goat still leaving two doors, one of which is a goat, and the other of which is the brand new car ?

I even considered it psychologically. Suppose the game show host WANTED you to win ? Well then it could be that he chose the 3rd door revealing it to be a goat to WARN the player that they are about ready to pick a goat, too, behind the 1st door, as the host obviously knows where all the prizes are, and they want you to CHANGE and pick the 2nd door where the car is so they win it ?

But now let us suppose the game show host wants you to LOSE ? That is the manager of the program said the host can keep the car for himself if the player does NOT choose it. Therefore the host seeing that the player is getting ready to open the correct door with the car, the 1st door, opens up the 3rd door revealing the goat and then asks the player would they like to change their choice from the first door to the 2nd door, hoping it will encourage them to change doors and get the wrong answer.

At all times we must assume the HOST knows where all 3-items are, otherwise he would not just willy nilly pick the 3rd door for it - knowing it to be a goat. If he just jumped in and randomly picked, it could've been the car - and then where does the game go ? So no, that option is out. The host clearly knows where the two goats are and the vehicle at all times.

So ... how can it be proven, clearly and easily, under these circumstances that the player after the host opens the 3rd door revealing a goat ONLY, leaves the player a 2 out of 3 chance of winning the new automobile instead of what is more to be believed a 50-50 chance for it ?

And don't forget the player could've been reaching for the second or third door as well. And we must think that once again the game show host reaches for one of the other doors that contains a goat to reveal it to the player - to either encourage or confuse them.

P#123685 2023-01-05 00:12 ( Edited 2023-01-05 00:21)

SHOW MORE

Hey @zep.

Yes, you. The man of the hour.

Could you please do three things, please ?


If you click on a Sprite that is not on the page, while the # does change, in this case, 35, the sprite page stays on wherever you left it. Suggest it jump to the page where sprite #35 is seen. So clicking would yield:

This ^^ instead.


The 2nd thing is to add information to show which sprite you are HOVERING over. Not right-clicking, just by having the mouse atop a sprite will tell what # it is. It could be put in the red area below where there is ample space.


The other is to not show the vertical position in the map if the mouse is no longer hovering in the map area or even if you click in the sprite area - it still shows the map vertical position. Instead show the Sprite-Y position.

P#123575 2023-01-03 02:53 ( Edited 2023-01-03 04:47)

SHOW MORE

Cart #bigdaddyfatkeys-1 | 2023-01-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5
(v01 01-02-23)
TO LOAD THIS PICO-8 CART, in immediate mode, type: load #bigdaddyfatkeys

Hello.

Having been chatting with @Sosasees, here:

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

I noticed that the icon to the left of the post looked like an oversized keyboard that wouldn't fit on the screen.

So it got me to thinking ...

While I was working on a type of room builder I quickly set that aside and began working on drawing big fat letters that might look perfect in a 24x24 field or 3x3 8x8-pixel sprites and use the 24x24 pixeled box I made.

Naturally it would be too big for the screen. So you would use the mouse to SCROLL for the keys.

And that is the result I have. Hold 🅾️ to hold down the SHIFT key.

Now I don't expect to do anything with this. You can't type with it. I haven't written code for that yet.

If you want to experiment move the mouse pointer so it touches every letter of your first and last name -

And yeah, you get a headache pretty quickly from scrolling all over the place ! :)

Yet I wanted to see if it was possible to do - to make an area so big as it would appear nice and legible on even the smallest of cellphones. Allowing you to drag your finger across and stab at a button to register it in your text entry.

If you found this amusing or have any questions about it, please let me know !

Thanks !

P#123567 2023-01-03 01:54

SHOW MORE

Agh ! It's ... well, maybe hideous is saying too much. In any case it certainly doesn't belong there.

Here is a screenshot of the mapper. I was experimenting with a box for a set of rooms that are 3x3 8x8 sprites in size.

No problem here.

But now watch what happens when I scroll up by one tile.

The dot appears ! I know this dot is used to denote that a tile you chose in the mapper may be black but is not the first tile #0.

In this case it most certainly is tile #0 so it should not be appearing, @zep. And it only appears in this instance.

So for it to appear depending upon which part of the map you are viewing is incorrect and definitely an error.

P#123546 2023-01-02 23:12 ( Edited 2023-01-03 02:21)

SHOW MORE

Hello.

I was just copying the source-code from one of my later projects and ran into an interesting problem.
Here, try this out:

Cart #dotty-0 | 2023-01-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

Runs great, right ? But now click Code▼ click anywhere in the source-code field, press CTRL+A, then CTRL+C, then in a new Pico-8 boot, in the source-code editor, press CTRL+V.

cls()
repeat
るきるきpset(rnd(128),rnd(128),rnd(16))
るきるきflip()
untilるきforever

るきるき ⬅️

What is happening here ?

It looks like SPACES are being replaced by some other characters. This does not just appear for me but any code you try.

Clearly it's a bug of some kind.

P#123517 2023-01-02 18:10 ( Edited 2023-01-02 18:33)

SHOW MORE

Hello !

With the arrival of Picotron comes a great system with a great many errors too. :)

🇵

I am using this symbol in my title until the category "Picotron" has been created. If you want to post your own Pictron code, in absence of a category you can use that emoji too. Just double-click it, press CTRL+C, then CTRL+V to paste it out later in your Picotron title.

Functions are now working and I did manage to write this to demonstrate how to access a multiarray image both in main code and a function. You are also welcome to use the font and sprites I drew and code I typed in your own Picotron projects.


Here now is the code you can try out in Picotron for the display above which includes the 1-line function to display custom 8x8 font + sprites in your own code. First highlight all of the code you see in white below. Move the mouse pointer so it is touching just before the first "-" and holding down the mouse button drag the mouse down all through the code. Let go when you reached the bottom line. Then let go of the mouse entirely.

Instructions continue after code.

-- 128-character 8x8 Pixel Font Library
-- Written by dw817 (01-02-23)
-- Standard Lexaloffle License (see notes where you found this cart)
function _init()

-- Clear screen.
  cls()

-- This string contains all 128 8x8 pixeled characters.
-- They are in no way compressed. If you want compressed, let me know and I will write
-- the code for it.
  fontz="000000000000000000000000000000000000000000000000000000000000000000077000007777000077775000077550000055000007700000005500000000000770077007750775005500550000000000000000000000000000000000000000077077007777777007757755777777700775775500550550000000000000000000077000007777700775555500777700000557700777775500577550000055000000000007700770077577550057755000775770077557750055005500000000077700007757700007775770775777557755775007775770005550550000000000077000000775000077550000055000000000000000000000000000000000000000770000775550077550000775000000770000000577000000055000000000077000000057700000007700000077500007755007755500005500000000000000077000770775770777777507777775775775770557750500005500000000000000000000077000000775000777777000577555000775000000550000000000000000000000000000000000000000000007700000077500007755000005500000000000000000000000000077777777055555550000000000000000000000000000000000000000000000000000000000077000000775000000550000000000000007700000777500077755007775500777550007755000005500000000000007777700775557707757077577575775775057750777775500555550000000000077700000077500000775000007750000077500007777000005555000000000007777000775577000555775000775550775550007777770005555550000000007777770005577550007755000005770077007750077775500055550000000000000777000077555007757700775577507777775005557750000005500000000077777700775555507777700005557700770077500777755000555500000000000077700007755500775770007750770077507750077775500055550000000000777777000555775000077550077775000775550077550000055000000000000077777700775577500777755077557700775077500777755000555500000000000777700077557700775077500770775000577550077755000055500000000000007700000077500000055000000000000077000000775000000550000000000000770000007750000005500000770000007750000075500007550000005000000000770000775550775550000577000000057700000005500000000000000000000000007777770005555550777777000555555000000000000000000000000077000000057700000005770000775550775550000550000000000000000000000777700077557700055077500077555000055000007700000005500000000000077700007055700705770707570757575777755070555500077700000055500000777700007577500775775007557750775777507550775005000550000000007777770077557750775775507750770077507750057775500005550000000000077777007755555077500000775000000770000000777700000555500000000077770000775770007750770077507750775077507777755005555500000000007777770077555550775770007750550077500000077777000055555000000000077777007755555077577000775055007750000077500000055000000000000007777000775555007750000077577700775077500777775000555550000000007700770077507750777777507755775077507750775077500550055000000000077770000077550000775000007750000077500007777000005555000000000000777700000577500000775000007750770077500777755000555500000000007700770077577550777755007777500077577000775077000550055000000000770000007750000077500000775000007750070077777750055555500000000770007707770777577777775775757757750577577500775055000550000000007700770077707750777777507757775077507750775077500550055000000000077770007755770077507750775077507750775007777550005555000000000077777000775577007750775077577550775055007750000005500000000000000777700077557700775077500777755000775500077770000055550000000000777770007755770077507750777705507757700077507700055005500000000000077700007755500077500000775000007750007775500005550000000000007777770005555550007700000077500000775000007750000005500000000000770077007750775077507750775077507757775007707750005505500000000077077700775077507757755077775500777550007755000005500000000000077007770775007757750077577570775777777750775777500550555000000000770077000777755000775500007750000777700077557700055005500000000077007700775077507750775007777550007755000077500000055000000000007777770075577550057755000775500077550700777777500555555000000000077770000775550007750000077500000775000007777000005555000000000077000000777000000777000000777000000777000000775000000550000000000777700000577500000775000007750000077500077775000055550000000000000000000070000007770000775770077550770055000550000000000000000000000000000000000000000000000000000000007777770005555550000000000777700000777500000775000000750000000500000000000000000000000000000000000777700000557700077077507755775007777750005555500000000077000000775770007750770077507750775775507777550005555000000000000000000007777000775555007750000077500000077770000055550000000000000077000770775077557750775077507750775007777750005555500000000000000000077770007755770077577750775055500777700000555500000000000007770000775550077777000077555000775000007750007775500005550000000000000777770077557750775077500770775000557750077775500055550077000000777770007755770077507750775077507750775005500550000000000077000000055000077700000077500000775000007750000005500000000000000770000000550000777000000775000007750000077500777755000555500077000000775077007757755077775500775770007750770005500550000000000777000000775000007750000077500000775000007770000005550000000000000000077707700777777707757577577505775775007750550005500000000000000000770770007770770077557750775077507750775005500550000000000000000007777000775577007750775077507750077775500055550000000000000000007777700077557700775077507757755077505500775000000550000000000000777770077557750775077500770775000557750000777700000555500000000077077000777077007755055077500000775000000550000000000000000000000007770000775550007750000077500077755000055500000000000007700000077770000775550007750000077500000077700000055500000000000000000077007700775077507750775077577750077077500055055000000000000000007700770077577550777755007775500077550000055000000000000000000007700077077500775775707757777777507757775005505550000000000000000077007700077775500077550007777000775577000550055000000000000000007700770077507750775077500770775000557750077775500055550000000000777777007557755005775500077557007777775005555550000000000007770007777750777777507777775007777750005777500000555000000000007700000077500000775000000550000077000000775000007750000005500077700000777770007777770077777750777775507775550005550000000000000000000077700007757707705507775000005550000000000000000000000000077700007055700707770707575557575777075070557550077755000055500aa404aa0a4a4a4a00afffa0057bfb7504f3f3f40a4fff4a00a404a00000000000000000084080480084848008484848087cdc7804f1f1f4004fff40000000000000a0000009a9000aaa7aaa004aaa40009a9a9000a404a0000000000000000000444440099999990444444409a979a909a999a909aaaaa909999999000000000000000000220220027828820288888200288e20000282000000200000000000000dcd0000c1c1c00d1c1c1d0cc171cc0d1c1c1d00c1c1c0000dcd0000000000009aaa9009a999a90a99a99a0a9aaa9a0a99a99a09a999a9009aaa90000000000022e22002e2d2e20222e2220ede7ede0222e22202e2d2e20022e220000000000c7c11111111c7c11111111111111111111111c7c1c7c11111111111111111111bbbbbbbbbabbbb3bbb3bbabbbbbbbbbbbbbbbbbbbbabb3bbb3bbbbabbbbbbbbb0000000006777600670707606780876006777600000000000067600000000000055006505845d000548d5d6005dd65050d566a0060d5a59050600900000500000044400000999000097079000a700a000977790000999000004440000000000000000000575000007675000000675000007667600000707000006760000000000067600007d0d70006d0d600dd676dd0d67076d0dd707dd0d66666d000000000077777760766666d06dddddd0000000077760777666d0766dddd06dd00000000000000000000000000555555005777770057777700577666005776000057760000000000000000005555555577777777777777776666666600000000000000000000000000000000555555007777750077777500666775000067750000677500005776000057760000577600005776000057760000577600005776000057760000000000000000000000000075757575000000000000000000000000000000000067750000677500006775000067750000677500006775000067750000677500005776000057760000577666005777770057777700555555000000000000000000000000000000006666666677777777777777775555555500000000000000000067750000677500666775007777750077777500555555000000000000000000000000000000000000000000000d000000000000000000000000000000000000d11111111000000010000000100000001000000010000000100000001000000000000000000000600000d56000d5d560d5d56660d56667706667777000000000444444404000004049000040495900404959594049595940444444400000000044a4406045550660455067604550676045506760444066000000600000000000070000000dddddd00ccccd000cccd0000ccccd000dddddd00700000000000000000000a00000090000dd80000d00d000d0000d00d0000d000d00d00000dd0000"

-- Draw out all 128-characters so you can see what they look like.
  for i=0,3 do
    for j=0,31 do

-- Draw them centered and near the top of the screen. See below for print8() function.
      print8(chr(j+i*32+32),112+j*8,8+i*8)
    end
  end

-- Set a sample string to display. Note character #130 for gold stars.
-- See original post for key number of all special characters.
  t="\130 Welcome To Picotron - Wave Of The Future ! \130"

-- Print 16-lines down.
  for i=0,15 do

-- Call custom function print8(). See details at function.
-- Notice that x-position gives nice wavy motion.
    print8(t,56+sin(i/15)*24,i*10+56)
  end
end

-- As flip() does not yet work, I have to have this function to make sure our command
-- prompt doesn't overwrite the display.
function _update()
end

-- Custom print 8x8 character from included font stored in string fontz.
-- t = Text to print. Use \128 to \159 for special characters.
-- Each character is separated by 8-pixels horizontally.
-- x = X-position pixel on screen.
-- y = Y-position pixel on screen.
function print8(t,x,y)local a for i=1,#t do a=(ord(sub(t,i,i))-32)*64+1 spr(userdata("[gfx]0808"..sub(fontz,a,a+63)),x,y)x+=8 end end

If you haven't already, highlight that code above. Once it is fully highlighted, press CTRL+C. Then go to this website:

https://www.lexaloffle.com/picotron.php?page=playground

From there click the big triangle to start it. Press [ESC], CTRL+V, the ENTER key, and CTRL+R to run it. Press [ESC] twice to return back to source-code view.


To have this 8x8 font and game sprites in your own original code, you really only need a few lines.

function _init()
  fontz="000000000000000000000000000000000000000000000000000000000000000000077000007777000077775000077550000055000007700000005500000000000770077007750775005500550000000000000000000000000000000000000000077077007777777007757755777777700775775500550550000000000000000000077000007777700775555500777700000557700777775500577550000055000000000007700770077577550057755000775770077557750055005500000000077700007757700007775770775777557755775007775770005550550000000000077000000775000077550000055000000000000000000000000000000000000000770000775550077550000775000000770000000577000000055000000000077000000057700000007700000077500007755007755500005500000000000000077000770775770777777507777775775775770557750500005500000000000000000000077000000775000777777000577555000775000000550000000000000000000000000000000000000000000007700000077500007755000005500000000000000000000000000077777777055555550000000000000000000000000000000000000000000000000000000000077000000775000000550000000000000007700000777500077755007775500777550007755000005500000000000007777700775557707757077577575775775057750777775500555550000000000077700000077500000775000007750000077500007777000005555000000000007777000775577000555775000775550775550007777770005555550000000007777770005577550007755000005770077007750077775500055550000000000000777000077555007757700775577507777775005557750000005500000000077777700775555507777700005557700770077500777755000555500000000000077700007755500775770007750770077507750077775500055550000000000777777000555775000077550077775000775550077550000055000000000000077777700775577500777755077557700775077500777755000555500000000000777700077557700775077500770775000577550077755000055500000000000007700000077500000055000000000000077000000775000000550000000000000770000007750000005500000770000007750000075500007550000005000000000770000775550775550000577000000057700000005500000000000000000000000007777770005555550777777000555555000000000000000000000000077000000057700000005770000775550775550000550000000000000000000000777700077557700055077500077555000055000007700000005500000000000077700007055700705770707570757575777755070555500077700000055500000777700007577500775775007557750775777507550775005000550000000007777770077557750775775507750770077507750057775500005550000000000077777007755555077500000775000000770000000777700000555500000000077770000775770007750770077507750775077507777755005555500000000007777770077555550775770007750550077500000077777000055555000000000077777007755555077577000775055007750000077500000055000000000000007777000775555007750000077577700775077500777775000555550000000007700770077507750777777507755775077507750775077500550055000000000077770000077550000775000007750000077500007777000005555000000000000777700000577500000775000007750770077500777755000555500000000007700770077577550777755007777500077577000775077000550055000000000770000007750000077500000775000007750070077777750055555500000000770007707770777577777775775757757750577577500775055000550000000007700770077707750777777507757775077507750775077500550055000000000077770007755770077507750775077507750775007777550005555000000000077777000775577007750775077577550775055007750000005500000000000000777700077557700775077500777755000775500077770000055550000000000777770007755770077507750777705507757700077507700055005500000000000077700007755500077500000775000007750007775500005550000000000007777770005555550007700000077500000775000007750000005500000000000770077007750775077507750775077507757775007707750005505500000000077077700775077507757755077775500777550007755000005500000000000077007770775007757750077577570775777777750775777500550555000000000770077000777755000775500007750000777700077557700055005500000000077007700775077507750775007777550007755000077500000055000000000007777770075577550057755000775500077550700777777500555555000000000077770000775550007750000077500000775000007777000005555000000000077000000777000000777000000777000000777000000775000000550000000000777700000577500000775000007750000077500077775000055550000000000000000000070000007770000775770077550770055000550000000000000000000000000000000000000000000000000000000007777770005555550000000000777700000777500000775000000750000000500000000000000000000000000000000000777700000557700077077507755775007777750005555500000000077000000775770007750770077507750775775507777550005555000000000000000000007777000775555007750000077500000077770000055550000000000000077000770775077557750775077507750775007777750005555500000000000000000077770007755770077577750775055500777700000555500000000000007770000775550077777000077555000775000007750007775500005550000000000000777770077557750775077500770775000557750077775500055550077000000777770007755770077507750775077507750775005500550000000000077000000055000077700000077500000775000007750000005500000000000000770000000550000777000000775000007750000077500777755000555500077000000775077007757755077775500775770007750770005500550000000000777000000775000007750000077500000775000007770000005550000000000000000077707700777777707757577577505775775007750550005500000000000000000770770007770770077557750775077507750775005500550000000000000000007777000775577007750775077507750077775500055550000000000000000007777700077557700775077507757755077505500775000000550000000000000777770077557750775077500770775000557750000777700000555500000000077077000777077007755055077500000775000000550000000000000000000000007770000775550007750000077500077755000055500000000000007700000077770000775550007750000077500000077700000055500000000000000000077007700775077507750775077577750077077500055055000000000000000007700770077577550777755007775500077550000055000000000000000000007700077077500775775707757777777507757775005505550000000000000000077007700077775500077550007777000775577000550055000000000000000007700770077507750775077500770775000557750077775500055550000000000777777007557755005775500077557007777775005555550000000000007770007777750777777507777775007777750005777500000555000000000007700000077500000775000000550000077000000775000007750000005500077700000777770007777770077777750777775507775550005550000000000000000000077700007757707705507775000005550000000000000000000000000077700007055700707770707575557575777075070557550077755000055500aa404aa0a4a4a4a00afffa0057bfb7504f3f3f40a4fff4a00a404a00000000000000000084080480084848008484848087cdc7804f1f1f4004fff40000000000000a0000009a9000aaa7aaa004aaa40009a9a9000a404a0000000000000000000444440099999990444444409a979a909a999a909aaaaa909999999000000000000000000220220027828820288888200288e20000282000000200000000000000dcd0000c1c1c00d1c1c1d0cc171cc0d1c1c1d00c1c1c0000dcd0000000000009aaa9009a999a90a99a99a0a9aaa9a0a99a99a09a999a9009aaa90000000000022e22002e2d2e20222e2220ede7ede0222e22202e2d2e20022e220000000000c7c11111111c7c11111111111111111111111c7c1c7c11111111111111111111bbbbbbbbbabbbb3bbb3bbabbbbbbbbbbbbbbbbbbbbabb3bbb3bbbbabbbbbbbbb0000000006777600670707606780876006777600000000000067600000000000055006505845d000548d5d6005dd65050d566a0060d5a59050600900000500000044400000999000097079000a700a000977790000999000004440000000000000000000575000007675000000675000007667600000707000006760000000000067600007d0d70006d0d600dd676dd0d67076d0dd707dd0d66666d000000000077777760766666d06dddddd0000000077760777666d0766dddd06dd00000000000000000000000000555555005777770057777700577666005776000057760000000000000000005555555577777777777777776666666600000000000000000000000000000000555555007777750077777500666775000067750000677500005776000057760000577600005776000057760000577600005776000057760000000000000000000000000075757575000000000000000000000000000000000067750000677500006775000067750000677500006775000067750000677500005776000057760000577666005777770057777700555555000000000000000000000000000000006666666677777777777777775555555500000000000000000067750000677500666775007777750077777500555555000000000000000000000000000000000000000000000d000000000000000000000000000000000000d11111111000000010000000100000001000000010000000100000001000000000000000000000600000d56000d5d560d5d56660d56667706667777000000000444444404000004049000040495900404959594049595940444444400000000044a4406045550660455067604550676045506760444066000000600000000000070000000dddddd00ccccd000cccd0000ccccd000dddddd00700000000000000000000a00000090000dd80000d00d000d0000d00d0000d000d00d00000dd0000"
end
function print8(t,x,y)local a for i=1,#t do a=(ord(sub(t,i,i))-32)*64+1 spr(userdata("[gfx]0808"..sub(fontz,a,a+63)),x,y)x+=8 end end

So it is essentially 2-lines of code. Where fontz the string is initialized and the 1-line function named print8()

Copy those and place in each respective function in your own code and you are all set !
To print in this font call print8(t,x,y) where t is a string like hello and x and y are pixel coordinates to draw this at. Use the backslash \ in the string to create special characters like \130 for gold star.

See next section below which details all the special game sprites.


.
If you stick with 8x8 pixeled sprites, you have 60-tiles across by 33-tiles down yielding 480-pixels across by 264-pixels down. In original Pico-8 you could only have 16-tiles across and 16-tiles down with 8x8 pixels, so it's worth considering using this size if you want to make large play areas like old DOS games did with their 80- or 40-characters across and 25-lines down.

Here are the special characters ASCII:

+128 Girl or NPC.
+129 Boy or Player.
+130 Gold Star or Experience Points.
+131 Treasure Chest.
+132 Life Heart.
+133 Jeweled Blue Crystal.
+134 Gold Coin.
+135 Jeweled Red Crystal.
+136 Water.
+137 Grass.
+138 Skull monster.
+139 Spider monster.
+140 Wristwatch or get more time.
+141 Key.
+142 Lock.
+143 Wall.
+144 Up to char #152 is to draw nice boxes and borders.
+148 Good to separate text lines vertically.
+153 Dot to see 8x8 area.
+154 Grid to see 8x8 area.
+155 Stairs leading up.
+156 Stairs leading down.
+157 Open doorway.
+158 Blue flag.
+159 Lit bomb.

So if you wanted to draw a Spider at 64,64 that would be print8("\139",64,64)


This code is Lexaloffle licensed. This means you can use this code and all images entirely for yourself without giving me any credit at all - provided the code is posted in the domain of https://lexaloffle.com/

This is true of all my Pico-8 projects, now, the past, and in the future. They are there for you to take and learn and build from and share in the Lexaloffle website. :)


If you find this helpful or have any questions about, please let me know.

Thanks !

P#123446 2023-01-01 20:41 ( Edited 2023-01-02 19:49)

SHOW MORE

Hi guys.

I'm not going to call this a bug cause it really isn't. However it is pretty inconvenient.

In light of the recent data compressor I wrote:

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

I am required to encode characters "0" (zero) to "9" as "\48" to "\57"

Why ? Well quite simply the system recognizes that \0 to \9 are read as single characters. So suppose you wanted to have character CHR(4) and character "8" in a string for data.

Well normally you would encode that as "\48" but now you see the problem. That also makes chr(48) which is character zero.

What I propose is, and you can make it optional, that "\" followed by a digit is disallowed as you can use \" for character 34 and all other non-printables like chr(10) and chr(13) already have equivalents.

This is controlled inside the code itself, possibly with an obscure POKE or even the command, nnbd() for "No numeric backslash definitions."

This of course also means that you would no longer have "\0" but a new character as
[8x8]
to type in your code, or simply use "\z"

Achieved and retrieved from printh(chr(0),"@clip")

In this with "\digits" no longer being viable, true 256-byte data can be stored with a minimal of fuss and not requiring coders to use \48 to \57 for simple digits 0 (zero) through 9.

P#123379 2022-12-31 20:26 ( Edited 2022-12-31 20:35)

SHOW MORE

Hello, @zep.

This is a simple request. I would like a key, perhaps "V" to turn on and off the text that appears on top of a cart's logo in Splore.

For instance, you can see HERE:

Some very nice art drawn of the soldiers by @paranoidcactus. I would like a key to hide the text that appears below the half of the screen so it can be fully seen and appreciated. Bonus if you can still navigate using UP and DOWN arrow keys while hiding the text.

A bonus command of showlabel() would also be nice so no-one would need to include code to draw their logo each time. You merely call that and it transfers the LABEL data to the screen. To make sure no-one uses this just for data though you could set it so when you do Show Label, one of two things happens:

  1. Show label, wait for keystroke, clear screen.
  2. Show label. No way to read pixels or even memory for it but can draw on top of it, like score, level, information, etc.

Would anyone else like this ability ?

P#123134 2022-12-27 18:43 ( Edited 2022-12-27 20:29)

SHOW MORE

Cart #flinger-1 | 2022-12-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7
(v01 12-25-22)
TO LOAD THIS PICO-8 CART, in immediate mode, type: load #flinger

Hello.

This is especially for @Dawnoboo who earlier asked how can launch slime with mouse.

From what I can tell they want where you can grab an object and release it quickly with the mouse giving it a "flinging" effect.

This then is the heavily documented code I wrote for it this Christmas morning. It also demonstrates how you can pick up an object dragging it with the mouse.

If you found this code to be helpful for you or if have any questions, please let me know.

Thanks ! 🎅

P#123016 2022-12-25 18:06

View Older Posts
Follow Lexaloffle:          
Generated 2024-03-19 08:16:24 | 0.154s | Q:59