Simulate Movement

Get help using Construct 2

Post » Fri Mar 29, 2013 10:19 pm

So I have a Hero with 8 Way Movement Behavior, but I am not using the Keyboard. I created Sprites for each direction, but it doesn't appear that in the Conditions and Actions you can select Diagonals, only Up,Right,Down,Left. Any idea how to code it so you can move diagonal?

Thanks
Brett
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Fri Mar 29, 2013 10:31 pm

Setting actions to simulate controls in 2 different directions should work. So if you simulate pressing up and simulate pressing right at the same time, the sprite should move at an up-right diagonal.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Post » Fri Mar 29, 2013 10:37 pm

You can simulate more than on direction at a time.
Right, and down would give you.....

Edit:
ninja'd

Also you might want to set up your own movement at some point. A diagonal is just changing both x, and y. newt2013-03-29 22:41:16
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat Mar 30, 2013 12:29 am

Wow, I feel stupid, totally should have tried that first. Thank you. Thanks newt that is something to think on for the future, right now I just need basic, but that is good to know.

Brett
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Sat Mar 30, 2013 3:39 am

INTERESTING FIND!

So I did what you suggested and all good, but I also stumbled onto something very interesting, you don't actually need the Diagonals. Yes, check this out.

I have 4 Sprites for N,E,S,W setup in that configuration. I have the events setup so that "Is in Touch" so as you drag your finger across N Hero moves North, as you drag your finger across E Hero moves East and so forth, BUT Here is the magic IF your finger drags/is overlapping two sprites for example N and E the Hero moves NE, Yes diagonally North-East.

That is excellent, I am sure Ashley is going to be like duh I coded that in there :)

Nice find, saves me 4 other sprites or frames.

Thanks
Brett
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Sat Mar 30, 2013 6:13 am

Zelda? They did that before, without the touch screen.
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,362


Return to How do I....?

Who is online

Users browsing this forum: michaelverdi and 18 guests