Skip to content

Movement improvements#9

Merged
Sslaxx merged 4 commits intomasterfrom
movement_fixing
Sep 13, 2021
Merged

Movement improvements#9
Sslaxx merged 4 commits intomasterfrom
movement_fixing

Conversation

@Sslaxx
Copy link
Owner

@Sslaxx Sslaxx commented Sep 13, 2021

Minor improvements to the movement code, plus other things.

  • Made the movement code use strength of direction.
  • Added export variables for walk/jog/run thresholds for use with different characters.
  • Changed some variable names to be more human-friendly.
  • Made the player facing code more robust (apparently).

Fixes #7

As far as I can tell, doesn't fix any other issues, but doesn't seem to make them worse either. Hopefully this'll be a decent base for further fixes - either #3 or #6 should be tackled next.

* Just added a text document outlining what I hope to do!

Signed-off-by: Stuart "Sslaxx" Moore <stuart@sslaxx.co.uk>
…that

are tested is the way to go here. Keep going until it's ready to be merged
into master. Definitely do NOT just rewrite the thing from scratch.

* Hooked up the movement direction to input strength.
* Changed velocity to use it.
* Removed one of the sprite facing lines, and changed the other to take
  velocity's X direction into account. Also moved it into the general
  physics processing function to allow grinding, being in the air etc. to
  be taken into account.

It seems to work at least as much as the older code did (not that very much
has been changed yet). No issues fixed as of yet, though. Not that this is
intended to, just provide a platform for doing so.

Not for this branch, but future plans include moving all the player control
code into _input.

An "interesting" side-effect is that the walking down walls bug has a new
wrinkle. While walking down a wall the player is facing up. Well, that's
for when I open a branch to fix that issue.

Signed-off-by: Stuart "Sslaxx" Moore <stuart@sslaxx.co.uk>
* Made the condition for checking facing direction take into account both
  movement direction and velocity. Unsure if it's 100% perfect, but it - so
  far - appears to work.
* Renamed some related variables to be more "human-friendly".

Signed-off-by: Stuart "Sslaxx" Moore <stuart@sslaxx.co.uk>
* Given certain values more "human-friendly" variables to use for them.
* Made some variables exportable, helping making it "easier" to create
  other characters that may have different limits.

Signed-off-by: Stuart "Sslaxx" Moore <stuart@sslaxx.co.uk>
@Sslaxx Sslaxx merged commit c0242ac into master Sep 13, 2021
@Sslaxx Sslaxx deleted the movement_fixing branch September 13, 2021 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Direction player is "looking" doesn't always reflect direction they're moving.

1 participant