Log In  
Follow
s6maestro
[ :: Read More :: ]

Basically what asked in the title. Is it possible to define a variable name in Lua without defining a value just yet?

For example, would

local tick

work as a way to define, in a function, a local variable named "tick" as a "nil" value automatically?

Sorry for the dumb question

P#143816 2024-03-19 09:39 ( Edited 2024-03-19 09:39)

[ :: Read More :: ]

I can't wrap my head around this issue, because it really seems like there is none, and I feel like either I am going schizo or PICO-8 is.

I'm working on a prototype platformer to learn a bit.

Basically, the logic of the animation I came up with is making a timer that could count up to 10 by 0.5 per frame in the update() function (so, basically, a timer that went up by 1 every two frames).

I then set up my commands function so that every time i press either left or right, the player not only moves in that direction, but also changes sprites in its spr() function (the player sprite is saved in the PL table under the SPT variable).

This is done by calling a custom function, anim() in the if statements of the commands() function. anim() is a custom function that basically changes the PL.SPT (the player sprites) based on the value of the timer I spoke about earlier.

So far so good. Surely not the most efficient way to pull this off, but still, glad I worked it out. Except I didn't, because even though it works with the left button, I CANNOT get it to work with the right button. I just cannot find a reason for the left button to work and for the right button not to, but it just doesn't and tbh I'm going crazy because I really can't see an issue with my code (except extremely high inefficiency :D).

I know this is not the best way to pull off the animation, but now its beyond my point. I REALLY wanna know what's wrong with this code above all else.

ALSO the AND X<10 in the BTN if Statements are useless, I already realized that.

Cart #feguzakuhe-0 | 2023-07-29 | Code ▽ | Embed ▽ | No License

P#132542 2023-07-29 22:05 ( Edited 2023-07-29 22:13)

[ :: Read More :: ]

I just started using PICO-8 for the first time and using it for a little metroidvania project I had in the back of my mind for a while.

My question as of now doesn't regard coding or techs, but user experience.

Why is my sprite palette pretty much cut to a third of its full size at the bottom of the screen WITHOUT the possibility to navigate? I'm literally prevented from accessing a good portion of the tile palette because the interface just won't let me scroll, zoom or even pan on the tile palette except if I'm in the sprite editor with in Sheet mode (I'll call it that because I don't know what else to call it, basically the sprite editor without the editor itself) I can only navigate the map editor, while the tile palette is completely fixed in place whether I'm in the sprite editor or the map editor.

This honestly feels like a huge problem for a platform this popular, so I'm sure I'm just missing something? How do I navigate this hell?

P#129749 2023-05-15 10:43 ( Edited 2023-05-15 10:44)