I like this game, but my main peeve with it is how your character can exist on sub-pixel coordinate values but is (obviously) always displayed rounded to the nearest pixel. How close am I to the edge? Do I need to be a fraction of a pixel closer to make this jump? How do you guage such a thing?
If I may suggest a solution, you ought to have the player gravitate towards the center of the pixel they're on if they stand still for X amount of time without pushing a direction.
Thanks for the feedback Connorses! You're partially right, it does work on fractional numbers, but only when you're holding the jump button. Moving without the jump button is done in whole numbers on a timer. As soon as you stop moving the timer resets and your x y position is rounded down to whole numbers.
I think the feeling of sub-pixel movement is two things:
1) Pico8 only has a floor function, no round function, so when you're not moving your position is rounded down no matter what. At some point I may see if I can change this.
2) The timer uses a modulo, which can be off by a frame depending on what the timer is at when you press a movement button. This one is a bit harder to fix, but I may do it at some point.
I honestly don't understand why basic stuff like this isn't built in:
function cei(x) return flr(x+0x.ffff) function rou(x) return flr(x+.5)
I get having a limited API, but it's just makework to leave those out, especially when they could be intrinsics that don't incur call overhead.
if your point is that those functions are not needed anyway, you just proved yourself wrong. had you needed a ceil(), you were wrongly going for flr+1. arnodick needed a round() but got stuck on the floor(). those functions are -very- basic, but not that easy or fun to write by yourself. more so if you're a beginner.
now if you're really into api minimalism, cos(x) is just sin(x+.25), flr is just band(x,0xffff).
bottom line, floor,ceil,round, like cos,sin,atan2, should always come in a bundle.
also, tokens ;)
My point wasn't that they aren't needed, because people obviously do need them, but that we could get by without them if we had to, which is in line with the principles behind PICO's API design, from my observation.
Using up additional tokens does suck however.
[Please log in to post a comment]