8 direction behavior - isometric movement

Get help using Construct 2

Post » Wed Jun 05, 2013 8:04 am

Maybe anyone else know this problem.
With 8-direction behavior enabled, the collisions work properly, but as soon as I create my own movement it acts a little glitchy, tries to glitch through sprites etc.

I want to setup isometric movement via:

up-arrow is down - (sprite.y-1 & sprite.x + 2) etc....

I tried it via 8-direction behavior and simulate controls, to simultaneously press up and right arrow. Seperated them and added +40 speed to the "left" one. But of course it won't act properly.
The movement was isometric but the camera was suddenly shifting to this direction^^.

Back to my question: Is it possible to make a copy of the 8-direction behavior and change its movement to isometric style?

I looked into the behavior but javascript is still too much for me :/zyblade2013-06-05 08:33:04
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Wed Jun 05, 2013 9:58 am

Hey,

You can try to modify the behavior, but there is no real need for this. Instead, just set the "default controls" to "No" in the behavior properties. In your event sheet, use the "Simulate contol" action on your sprite.
For example, in case the "up" key is down, you can simulate "up" and "right" controls, moving in diagonal.
The problem with this is that you will only move on the perfect diagonal (45). If you want to move faster on the X axis than on the Y one, you can add a second 8 direction behaviour on the sprite, simulate its controls too, and set its speed differently, so one behaviour moves the sprite on the X axis, the other on the Y one.
(I'm not a pro on isometric movement, but this seemed to do the trick for me)Guizmus2013-06-05 09:58:51
B
17
S
8
G
4
Posts: 461
Reputation: 6,097

Post » Wed Jun 05, 2013 10:15 am

Thanks, that works pretty well :)
I doubled the acc. dec. and max speed for the left right behavior.
Awesome :D
B
24
S
9
G
2
Posts: 294
Reputation: 3,160


Return to How do I....?

Who is online

Users browsing this forum: danul777 and 3 guests