4 direction movement?

Get help using Construct 2

Post » Sun Mar 11, 2012 10:29 pm

How can I move smoothly an object from A to B and then to C.
Let's say I click at 3,3 and my character is at 0,0.
I want to move him from 0,0 to 3,0 and then to 3,3. How can I do that?
B
7
S
1
G
1
Posts: 37
Reputation: 1,159

Post » Mon Mar 12, 2012 1:41 pm

I don't know if this is the "correct" way to do it, as I'm still very new at this too, but I made this little example for you of how you might achieve what you're trying to do:

http://dl.dropbox.com/u/66278067/example1.capx

I just made a few "invisible" boxes, and created conditions so that when it arrives at one, it goes to the next. If you search "pathfinding" or "waypoints" you might find some more useful advice.

Hope that helps a bit :)

Edit: Sorry, given exactly what you wrote, you'd need to replace the first event to be a click to go to the first invisible box. From there, my example should get what you want :)MonstaMunch2012-03-12 14:08:12
B
6
Posts: 22
Reputation: 751

Post » Mon Mar 12, 2012 5:52 pm

[QUOTE=MonstaMunch] I don't know if this is the "correct" way to do it, as I'm still very new at this too, but I made this little example for you of how you might achieve what you're trying to do:

http://dl.dropbox.com/u/66278067/example1.capx

I just made a few "invisible" boxes, and created conditions so that when it arrives at one, it goes to the next. If you search "pathfinding" or "waypoints" you might find some more useful advice.

Hope that helps a bit :)

Edit: Sorry, given exactly what you wrote, you'd need to replace the first event to be a click to go to the first invisible box. From there, my example should get what you want :)[/QUOTE]

This is an extremely cool and helpful little demo that told me a lot. You can just work with points and not worry about a grid. Yum!
Check out my HTML5 Firefox OS Game Programming and Game Playing blog at http://firefoxosgaming.blogspot.com/ and my book on Amazon at http://www.amazon.com/dp/B00IZUYIGO. I wrote a newer post on using Construct for Firefox OS at http://firefoxosgaming.blogspot.com/201 ... -game.html.
B
16
S
4
G
4
Posts: 181
Reputation: 3,837

Post » Tue Mar 13, 2012 1:48 am

I'm talking about pathfinding but thanks for the example and sorry for not making a complete question :)
B
7
S
1
G
1
Posts: 37
Reputation: 1,159

Post » Tue Mar 13, 2012 1:27 pm

There's a plugin for that
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346


Return to How do I....?

Who is online

Users browsing this forum: SpartCrafter and 23 guests