It works but the sprite keeps bugging(blinking or out scaling) each time it changes the direction
Some of your rects are messed up. The second one for left, (35, 50, 59, 141), and the second for right, (35, 98, 59, 93), seem to have their bottom borders swapped.
Another potential issue I noticed: Using the same variable for each direction and only resetting it when going in neither direction, plus not doing anything if it's above 56, means that the player's sprite will stay facing the wrong direction if you release one direction and press the other one frame apart.
Edit to avoid double-posting: (^Text glow to help this not get lost, since that's happened a few times lately when I ask questions in edits.)
(Speaking of which, I still need those formulae for how acceleration/max speed are applied.)Today I was working on my package script, minding my own business, when all of a sudden everything between the background and the overlay (not everything in the stage frame - just certain priorities, I think) starts rendering somewhere around GetScreenWidth/2 to the left of where it's supposed to be when I start the game (any mode) through the package.
I'm pretty sure the only things I had been messing with when it started happening were the package (and the two libraries accompanying it), the player script, and (maybe) the pause script. Of those, the only thing I can think of that was really related to render priorities was changing the priorities of some of the effects in the player script in an attempt to fix a bug where the parts that are supposed to be transparent (ADD_RGB) aren't. While doing so I changed them from SetRenderPriority to SetRenderPriorityI, if that matters.
Honestly, though, I basically just have absolutely no idea why this has started happening.
Here's all of the code.
E: Whatever is causing it definitely involves GetScreenWidth. I changed the screen size in th_dnh.def as a test and all affected objects went off the screen entirely.
EE: It seems to return to normal at the end of a stage? Not when the stage scene is closed, but during the dialogue single at the end of the fight, after the boss explodes and is deleted. Happens with both dialogue singles I have to test.