frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

How to fix player randomly stopping while moving?

edited June 12 in How To
Hey I'm Sero I'm new to Flowlab. I want to make a RPG I'm currently just trying to learn how to get all the core mechanics working but I've noticed on my sprite when I make it move it will stop moving making it not spooth is there an easy fix? Heres my current project: https://flowlab.io/game/play/930527

edit: I fixed it :)

Comments

  • edited June 11
    it's because your attempted fix for the 'continued velocity' thing (where you continue moving when the key isn't pressed) isn't axis-specific and also doesn't take into consideration whether other keys are still being pressed

    you have the WASD keys set so when they keyup 0 is output to velocity x and y, this means for example when moving diagonally holding both W and D, releasing D will completely stop you instead of simply transitioning to moving up as W is still being pressed

    use this instead
    image
    larger picture https://i.imgur.com/74K5HLC.jpg

    there are many ways to fix your problem but for simple top-down movement this one is decent
  • Thanks but I figured out I just needed to make the keys repeat.
Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

Get In Touch