Log In  
Follow
softcounter
Follow

Hi all! I'm learning to use Lua as I make games, so this may have an easy answer. I just haven't figured it out yet:

Cart #thedustbbs1-0 | 2020-03-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


edit:

I placed the actual cart here from a recommendation in the comments. I've placed every shape except for the cube shape somewhere besides the start of the file in the code (grid & photo are in spreadinit() and the rest can be found in the presets tab). The cube & grid show up fine, but everything else seems to be difficult to find for the program.


original post:

I'm currently making a game where there are several 3d objects you can peruse & rotate. I'm using the same function to display the objects as well as 3d grid to help me visualize where I should map everything--

draw_shape(clutter[cs]) --clutter is a table with each object's name in it. which object gets shown is determined by cs, or cardspot, a variable that changes with the player's selection
draw_shape(grid,3) --grid is the name of the grid shape, and it uses a different colour from the default

--So the functions work as they should. When I started the code for this game, the info for each shape (point coordinates & which points to connect) was placed at the beginning of the file. So far so good.

The thing now is that I'm trying to move the shape info to the init() section of a game, so that the coordinates have a chance to reset to their defaults. This should work in theory, and it does work perfectly for draw_shape(grid), which is great! However, for any of the shapes that are pulled up using the clutter[cs] table, I am told that the local 'shape' value cannot be found.

I know the function works without the use of a table, so I would really like to understand why throwing a table into this process seems to wreck everything. Is it just one too many steps to process at a time?

This isn't the first time I've run into this problem, and my solution in the past has just been to write around the problem, usually throwing the table out & explicitly specifying which variables, or by moving the code to the easiest to access spot. I'd like to outgrow the former habit since it seems like a bad approach to coding, especially as things get more complicated. The latter seems possible, but the current placement does work well for non-tabled objects, so I'd like to avoid that as well if possible.

Anyway, that's my situation. Any thoughts & insights are super appreciated!

P#73624 2020-03-03 03:11 ( Edited 2020-03-03 22:29)

Hey y'all :) I'm currently working on a game where you look through various objects cluttering up your space & scrub them out of existence if you don't want them. Objects are placed onto the screen, one at a time, for you to observe & erase. The screenshots here show a rough draft of the mechanic--the brush goes to the right side of the screen, having come over from the left & "cleaned" a line through the box.

I've gotten a functional brush up & running (thanks to carts like shodo for reference!), but I want the game to be able to check if the object has been "erased" or not, aka if the object has been completely covered up by the brush drawing over it.

Because the background will be black, and the object is being drawn over in black, I'm thinking something that checks to see if the screen data equals 0 might work. I'm not really sure if that's how I should be approaching it, or even how to format it properly. There's also the fact that the brush will still be on the screen after erasing the object, so I don't know if there's a way to check for screen data while it's there, or if I also need to make sure that disappears too.

A blank screen!...almost.

I'm proud of the amount of progress I've made up to this point, but I'd love some help here if folks have any ideas! Still learning how the memory layout works with pico-8 & how much can be done with it, so I'm not sure how to check the screen data.

Thanks!

P#62886 2019-03-29 03:47 ( Edited 2019-03-29 03:56)

Hi y'all! I can't seem to access the code text snippets of any of the cart posts atm. Was there a recent update to the forums that changed this? Just curious, since I learn a lot from seeing how others put things together. Thanks!

P#59409 2018-11-28 03:24 ( Edited 2018-11-28 14:38)

Hi y'all!

I recently put together a little narrative game in pico-8, but am getting feedback that for some folks, the in-game font just isn't legible, which makes it kind of unplayable for them. Oh no! Now I'm looking into transcript options to help make things more accessible. The easiest thing would be to include a text file of everything in the game, but that feels a little impractical. I'm hoping I can go for something a little more dynamic, since this is a game after all!

My thought was that it might be possible to edit the HTML file that goes alongside the cartridge for publishing games. This hypothetical edit would make it so that players have the option to display the on-screen text in a more accessible font below the main game. It seems great in theory, but I'm not sure how possible it actually is. I know that smaller edits like frame colors are possible, but this would require communication between the game and the HTML file, which seems tricky, especially given the translation between the two coding languages. It seems a bit too aspirational from where I'm standing from.

Still, this would be an ideal setup for players who need a different font to play the game, so I'm coming to you all to ask for thoughts. Does this seem possible? Would it require a lot of extra coding? Has it already been done? Any input is helpful input!

Thank you :)

P#49309 2018-02-15 16:46 ( Edited 2018-02-16 02:25)

Follow Lexaloffle:        
Generated 2020-05-28 02:02 | 0.085s | 4194k | Q:34