Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    move a sprite left and right on its own

    Beginners
    3
    5
    201
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • waldron
      waldron F last edited by

      just need help with moving a sprite left and right on its own
      dir=> ? using maps and sprites
      i can do one direction but cant update it to change direction unless controlled

      1 Reply Last reply Reply Quote 0
      • SwitchedOn
        SwitchedOn last edited by

        How about;

        X=50
        setSpriteSpeed(sprite, X, 0)

        if sprite.x > somePosition then X*=-1

        That will flip the direction....

        waldron 1 Reply Last reply Reply Quote 1
        • waldron
          waldron F @SwitchedOn last edited by

          @SwitchedOn il try i think i did something similar but no dice

          1 Reply Last reply Reply Quote 0
          • Dave
            Dave Fuze Team last edited by

            @pianofire has an awesome demonstration of this with a map project and named areas. Looking at it, I can see you've posted on that - remember that changing the sprite.x property will actually change where it is on screen, whereas changing sprite.x_speed (sprite.x_speed *= -1) will change its direction

            waldron 1 Reply Last reply Reply Quote 2
            • waldron
              waldron F @Dave last edited by

              @Dave good point didn't think of that, copy and past time ;)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post