So, as shown in my previous two posts, I'm making an operating system for Pico-8 called P8OS.
I am making it so that Z, closest to the window/whatever key, activates the app menu, and X, right next to it activates the task menu, where you can see which windows/programs are active. I need to check for both of them every frame. Shortened down to the problematic code, here is where it goes wrong:
function btnk(k) local p=stat(30)and stat(31) if k!=nil then if(p==k)return true if(p!=k)return false else return p end end if(btnk('z'))inmenu=not inmenu if(btnk('x'))intask=not intask
It will not detect pressing X unless Z is pressed in the same frame, which is even more confusing.
Clearly something has gone desperately wrong somewhere in this code. I just can't pinpoint what.
P.S. Keep in mind that if you want to reproduce this you will need to call poke(24365,1) or equivalents at the start of your code.
This is my manifesto of sorts on how I plan to implement P8OS in the forseeable future. I will keep writing it over time. Basically, you'll see the post progress as I write it down.
Part 0: Decisions, decisions, decisions
First, I'll have to make some choices to fit the limitations of PICO-8. First and formost; will we allow external programs that can be installed onto any given person's copy of the OS? And if so, how will we fit this into PICO-8?
I have the answer to both of those questions. 1) Yes. 2) A VM.
A VM is perfect for this. If you manage to design a compact and efficient bytecode and run it efficiently, then you're set.
Second decision: Should our OS have multitasking? And, once again, if so, how?
Here are the answers: 1) Yes. 2) Instancing.
If we build our VM modularly, we should be able to have a single instance of the VM for each program, which if run asynchronously, would allow for multitasking.
Third decision: Should we use the mouse and keyboard?
As demonstrated by my extremely early and nonfunctional version of the OS, yes to both.
There are more decisions that I'll add in here later. For now, we're set.
Please give feedback on the current version. I want to know what you think!
This is a very early version of P8OS, a very creatively named operating system built on the one Pico-8 already has. I'm trying to do what the original Windows did, which is piggybacking on an existing framework and building off of that.
It really isn't much just yet, but here's a few lists for those who like them.
- Mouse and keyboard reading(really not much to brag about)
- A built in system clock
- A basic menu bar
- A (yet nonfunctional) app menu you can toggle with Z(closest to the Windows button)
- A very clever way of storing program names
- Custom VM with bytecode transfered through sprites
- A framework for said VM with access to writing files and stuff like that
- A code editor for the VM in the OS. So... a VM inside a VM with an editor for that VM inside an operating system built in an editor on an operating system.
I want to make it so that you can paste in programs you made for the VM from the clipboard since that would be cool and I like cool.
Anyways, I hope you enjoy doing nothing interesting in this glorified button pressing simulator. Give ideas if you can!
P.S. Please do check out my very clever way of storing program names. I'm too proud of it for you not to notice ;_;
Finally, track four! This is a short one.
It sounds like something from a trailer so there's one use idea!
If you want to translate the symbols, the language is Korean(I'm not Korean but it looks cool so...). Of course, if you already knew Korean, you would know that it was in Korean and you would understand the Korean since you already knew Korean. Y e a h . Anyways, enjoy!
So, I'm expanding my previously released map generator. I've added stuff like biomes, biome generation types, so on so on.
The thing is, I'm making this generator because I want to start an RP community with stuff like being able to claim territory.
My problem: The map is too small. 128x128 is not a high enough resolution for this map. I've modified for the map generator to work on 256x256 pixels, but that would mean I would have to take four screenshots and manually stitch them together, which is a very frustrating process.
So, my question is, is it possible to take a 256x256px screenshot?
EDIT: I think it's worth noting that for automatically taking screenshots in my code is done with
which could be a slight problem.
This is a terrain/island generator, based on one of my tweetcarts:
I modified it to automatically do the following things:
- First, run the program as normal.
- When there are no black/empty pixels, start a timer.
Once the timer reaches a certain treshold, do the following:
- Automatically make screenshot
- Enable pause menu(you'll see why)
- Reset cart
The reason it pauses after the screenshot is so that when you leave it unattended it will not just make ten thousand different islands without you knowing. Enjoy!
Here's the third song in Noclip! Made it last night. It's the longest track I've made so far! I'm pretty proud of it. Let me know what you think!
Making my own tiny, tile based version of SuperHot. Here's the prototype!
Arrows for movement
Z/C to use weapon if equiped. Otherwise punches
X to pick up weapon. Later, you will be able to throw them too.
S to skip a turn.
When you go past the top of the screen, you will be sent to the start. Later versions are planned to update the room when you exit it.
Bullets don't do anything yet since I haven't had enough time to do that yet(remote learning. Ughh.) Punching doesn't do anything either. One enemy is at the end of the room, but, once again, does not do anything. You can go through him if you want. I do want to keep working on this. Let me know what you think!
So, yesterday my brain exploded when I messed around with the new music filters introduced with 0.2.2, and went on a rampage of updating songs in my local carts to use them where neccesary, and just now I changed the music in the hello.p8 demo. I hope you like it!
I'm making a collection of songs called Noclip, which anyone here in the community can use with credit, a bit like ToyBox. Here are the tracks I've made so far, enchanced with 0.2.2 music effects!
Track One: Seen. Not sure what you would do with this one, but surprise me!
Track Two: SysNull. Spacey vibes. An expanded version of a song I made a bit of time ago.
If you use these, comment on the post so that I can see what you've done with them! I'm excited to see the uses of these songs.
Next demo! Pretty quick, I know. I actually made this one before the movement demo, but meh.
Basically, this demonstrates the system I made for storing planets in a compact way.
One sprite is equal to one solar system. The sprite is split up into columns, where every row is one piece of data.
0 - Sprite to use for planet. Once again, graphics not final.
1 - Start of what's known as the intelligence range. This range will limit species on this planet to minimum and maximum intelligence values, which will change the complexity of the species.
2 - End of intelligence range.
3 - Intelligence modifier. This value is in place to bring average intelligence closer to a certain value.
The rest are seeds for species, species structures, species society and the planet's terrain.
This allows for up to eight planets in one sprite, which if used effectively can let you handcraft a world, with less work and a lot more space.
Also, I came up with a main track for EverLost. That's what plays in the cart.
I'm planning on making a space exploration-game called EverLost and will be releasing demos of planned features. This is the first.
Fly around with arrow keys.
(O) key will switch between controlling ship and controlling pilot inside ship.
Yes, I am aware there are no collisions inside the ship. I'll add that in a later demo.
Please give feedback on movement and controls.
(graphics are not final)
Made a weird fade-type thing. I'm not entirely sure myself how the deterioration thing works, I just divide the draw colour by the deterioration factor and increase said factor by the deterioration rate every pixel. Messing around with the deterioration rate, starting factor and colour range yields different results, some radically different from others. Adding randomised
statements could be cool.
It is far too easy to create a softlock cartridge.
RUN() -- Softlocks program if run from Splore. The only -- way to stop is by closing PICO-8 entirely.
Of course, if run from the command line you can always just press ESC and everything will be fine. But I've tested this by running from Splore and there is no escape.
Try it yourself! Just make sure that you saved your work.
So, as I said in my previous post, I am working on a game jam game. There is a problem with the cart above. When score, which the game uses to check progression, reaches 35 it should change the lvl variable to 10 to progress the game. However, when it does eventually reach 35 nothing happens. I simply cannot tell what in the world is going on inside that would halt progression like this. The jam ends tomorrow afternoon BST and if this isn't fixed, I might not be able to upload on time.
So, I'm working on a game jam game, and I see speed-running potential in it. I'm trying to make a built in speedrunning overlay, and I need to be able to pause the
function so that in the transition areas the time pauses so you can rest for a bit. However, I haven't been able to find anything that can stop, or emulate stopping the time function. I need an answer by Friday afternoon BST since that's when the jam ends.
MACROS: An EyeBoss mod
- Added "COMPLETED!" text under
logo after finishing both Normal
Destroy and Normal Survival.
- Added outline style to boss core
- Completing a mode in Easy difficulty
will now tell you to "Complete Normal
- Added effects to music.
UPDATE 1.0 (Major!)
- Managed to add unlockables! After completing
a section(when the music changes) you will
get a skin with the colour of that section's
- Added mode-specific powers. If you complete
Survival(in Normal), you will get a new skin
with the name "SURV" which gives you two extra
lives in destroy and one extra life in survive.
If you complete Destroy(in Normal), your bullets
will do extra damage in Destroy and the timer in
Survive will be lowered to 10 seconds.
- Made the second to last music track actually be
unique from the one before it.
- Made a very subtle colour change to the background.
- Added victory sounds to both completing a single
mode and completing the entire game.
- Fixed an issue where boss timer in Survival is
10 without completing Normal Destroy.
- Get some of you guys' suggestions!
I'm modifying a 3D raytracing demo to make an engine, and I was doing pretty well until i came to the realisation: I had a limited amount of tiles. Basically, in the way that the original programmer, @Hiinds , designed it, only the top half of only the first page of the spritesheet is available for use. So, basically, what I was thinking is I could use the rest of the spritesheet, and when I no longer needed a certain texture but did need another, I could copy one of the textures into one of the usable slots. What I need is a method to copy a certain part of the spritesheet onto another. How do I do this (if possible)?
View Older Posts