Move actor based on touch and locked onto y axis
ralphbugs
Member Posts: 39
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?
Comments
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
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
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.
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.