for i in all(stars)do
hey! super quick and basic question, feel like ive definitely done this before but i am just not thinking hard enough rn but why isn't this working? no errors are being thrown so i feel like im definitely forgetting something super basic thats making it all break but i am still a beginner and can't seem to figure out what. ty for any help!
So there's nothing wrong with the array itself it's your x, y and spd values that are causing the problem.
Even though Lua indexes starting at 1 the top-left corner of the screen is (0, 0). That means (128, 128) is actually just off the bottom right-hand side of the screen. And since your spd value is positive when you update it, it just moves further off the screen.
Edit: Ugh, sorry didn't notice you're subtracting the spd. But it's still not showing because the pixel is still off the bottom of the screen even though it's not longer off the right.
By the way, in case you're not aware, you can put code inside triple backticks to display it a bit nicer on the BBS.
function some_code() return 0 end
[Please log in to post a comment]