frame

Howdy, Stranger!

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

Sign In Register

Character randomly gets stuck while walking?

I have this problem where my little character will be walking left or right just fine, and then it suddenly acts like it hit an invisible wall and can't continue. I have to make it jump or spam left and right to try and get it to go forward again. I made a long floor block in case the problem came from individual blocks it stands on, but it still happens sometimes on both. My enemy object also randomly gets stuck to a wall after colliding. Is there something I can put in or take out of my characters' behaviors that will prevent this?
http://www.flowlab.io/game/play/807319
Often times, I'll have it go one direction, like right, and it can't continue moving. I'll walk it back left, then walk right again and the invisible "wall" is still there. Jumping while right up against the "wall" prevents it from moving right while jumping, so I have to walk it left and jump over to move past it. I'm sorry if I'm writing too much, I just want to be clear first time around :y
Tagged:

Comments

  • In the keyboard behaviour you forgot to check the box Repeating
  • When do people actually stop asking this lol.

    Change the player's collision shape to circle.
  • Well, checking repeating did not fix it while as a rectangle. I didn't keep it as a circle because it causes the character to slide after jumping on an edge.
  • I think rounded edges in a square would fix it but @grazer hasn't seen my suggestion yet.

    If you don't want to change it to circle then you would have to do weird stuff: when colliding to the left or right move 1 pixel up (position behavior "+x", connect a number -1 to it). When colliding left move 3 pixels to the right, when colliding right move 3 to the left.

    If it's an enemy you would have to make a specific object for the enemy to collode with when it has to flip.

    This is what I did in Cube's Adventure 2.
  • The player character is also always a pixel above the ground (the enemy is doesn't float above the ground though), so should I factor that in?
Sign In or Register to comment.

flowlab.io

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

Contact us

Get In Touch