Move actor based on touch and locked onto y axis

ralphbugsralphbugs Member Posts: 39
edited July 2015 in Working with GS (Mac)

Hello,

I have a problem in moving my actor based on touch. I want to move my actor on Y axis only and it will stop moving on respective lane.

I've illustrate what I'm trying to achieve here. Can someone guide me on this, please?

postimg.org/image/4u5dliajv/

Comments

  • ralphbugsralphbugs Member Posts: 39
    edited July 2015

    Okay, I've somehow managed to get what I want but i don't know whether this is the correct way to do it.

    Can any gurus check on my work and give your suggestion?

    https://drive.google.com/file/d/0By5DNbqYRGiOXzFFNHZNMG1OV3M/view?usp=sharing

  • tintrantintran Member Posts: 453

    What you have is pretty good,
    but i'd try using "Move To" behavior
    and move to your hero's self.position.x and the y value instead and select "Run to Completion"
    It gives you a smoother move effect rather than a choppy animation like how you have
    now.
    http://www.mediafire.com/download/rihabp00wnvgxar/changeLaneTest_usingMoveTo.zip
    But it is your game so it's totally up to you how you want it to move. maybe appearing instantly is what you're going for :D

  • ralphbugsralphbugs Member Posts: 39

    Oh hi Tintran,

    Yes, I'm purposely using change attribute instead of move to to get that jumpy look (don't have to make animation sprite.. lol). But like you said, it might be better if it have smoother movement. Thanks for your tips!

    I'm getting excited now.

  • tintrantintran Member Posts: 453

    It's great getting excited about making a game isn't it? I think there are few things in life that gives you that kind of excitement.

Sign In or Register to comment.