How do I disable decimals on 8-Direction?

0 favourites
  • 6 posts
From the Asset Store
Character Sprite Pack: Walk 4 Directions made in illustrator
  • Hi,

    Another 8-Direction topic. I'm making a pixel-centric game, and my character uses the 8-Direction behavior. Rather than using acceleration and declaration, I want my chracter to move by full pixels. Decimals cause the character to look off from the environment at higher resolutions, which I want to avoid.

    I tried using the "pixel rounding" project setting, and for the most part it works fine. However, it becomes jittery when trying to move diagonally, which is really disorienting.

    I also tried rounding the character's position every tick. This not only didn't fully fix the problem (while their position would round at the end of movement, they would still use decimals when in movement), but it also causes collisions with other objects to become really buggy.

    How do I make my character move by exact pixels rather than using acceleration/deceleration using the 8-Direction behavior?

  • move a different object that controls the position, and set the sprite's position to that object but rounded

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Pythagoras theorem :)

    Edit: sorry, answered in the wrong post. It's about the difference in vector values when moving in diagonal.

  • move a different object that controls the position, and set the sprite's position to that object but rounded

    This has the same issue as pixel rounding, where diagonal movement is jittery. Moving in cardinal directions works great, though.

  • streamable.com/mja5vu it'S complicated, doubly so for pixel art, get in touch I guess

  • streamable.com/mja5vu it'S complicated, doubly so for pixel art, get in touch I guess

    I’ll probably just end up making a new topic for it since it’s sort of a completely different question than this topic’s. Thanks for the tip on using a different sprite though, I don’t know how I didn’t think about it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)