Log In  

Cart #fsatobugu-1 | 2024-01-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

This is my first blog update. I'm feeling a bit defeated. I'm not making meaningful progress any more. The progress I have made is all but entirely owed to tutorials from nerdy teachers and lazy devs. I'm now spending way more of my time trying to find relevant content to learn from than I am actually learning. I've spent hours combing through BBS posts, reddit, youtube, and discord. When I do find discussion that seems relevant to what I want do, it's rare that I am able to parse the code to learn from it. Trying to stay motivated and move forward.

What I have thus far:
-A running, jumping player sprite which I don't understand how to further animate without continuously looping through a cycle of sprites (How do I do a once-and-done animation?)
-A functional camera that follows the player
-Collision detection for the map tiles
-An expanding and contracting field of view effect which I have no idea how to adjust due to the math involved.
-A particle effect simulating kicked-up dirt whose location I'm not fully able to anchor behind the sprite when it's flipped.

What I would like to have:
-Some sort of animated background, perhaps glistening or dripping rocks.
-Breakable tiles for a digging mechanic.

P#139921 2024-01-09 23:11 ( Edited 2024-01-09 23:20)

1

To do something once and not repeat it, you can use a boolean (true/false) flag to keep track, setting it to true when you want it to start, and making sure to set it to false once the thing is done (in this case, once you've reached the final frame of your animation).

I'm not sure what you mean about anchoring your particle effects behind the player, but bear in mind that things are drawn on the screen in order, with later instructions drawing over earlier instructions.. so this may be a matter of drawing your particles before drawing the player.

For breakable tiles you will want to use your tile collision system with a map tile flag for "breakable" in addition to the normal solid wall flag. Then, when you collide with a tile with the breakable flag, use mset to set the tile to an open one at that position.

The PICO-8 manual and wiki are your best references, if you're learning you should look up every native function you use in the manual.

P#139950 2024-01-10 15:44

You are a godsend.

P#140044 2024-01-12 15:55

No problem! Feel free to ask any questions or share specific code that's giving you trouble.

Another general coding tip I would pass is to break progress into as small increments as you can and test at each step that things are working as you expect. Use the console, printh() in PICO-8 to spit out values as they're happening (or stop() to interrupt completely when reaching a certain point) to be certain of what's going on while your code runs. If something's not working as you expect and you just can't seem to figure out why, question your most basic assumptions about how it works (like a native function you might have been using for a while already). The reference docs (PICO-8 Manual) are the only real way to know how (most) things are supposed to work.

I like what you've made so far, this is a really great start! I don't have any completed games myself, so this is still a learning experience for me as well. Good luck!

P#140062 2024-01-13 05:38

Hey kozm0naut,

I'm not sure you'll see this but I figured I'd try. Thank you for the kind words of encouragement. I was able to create breakable tiles thanks to your reply. As far as printh(), I've tried several times to get pico to print to the terminal in OSX but it doesn't seem to work. I've followed every troubleshooting tip I could find regarding the feature. I've given up trying to get it to work.

P#140464 2024-01-22 23:44
1

Hi @8bit_gnosis FYI you can use @ before my username and I will get a notification (but not at the start of a line due to a current BBS bug)

I'm glad you were able to make progress! Unfortunately I don't run in OSX so I'm not sure what the issue may be there, but I would just advise to make sure you are running PICO-8 from a terminal window, then printh calls should print to that same terminal (but not sure what to do if this is not working for you)

However, we can use print() in much the same way for debugging, you may just need to worry about positioning the print on-screen (starting from your current camera coordinates).

Also, I've recently learned that if you use stop() or hit Esc while your code is running, you can use terminal commands like print() to print variables from your code as it was running to see what their values are at that moment, and use the command resume to continue the program execution from that point.

P#140497 2024-01-23 17:02

Thanks @kozm0naut. I re-visited printh and got it to work by opening the pico-8 package contents and then clicking on the unix executable, which then opens up a terminal window along with Pico-8. For some reason, simply launching Pico-8 from the terminal itself didn't work.

P#140604 2024-01-25 17:26

[Please log in to post a comment]