Get 8-direction to work with rotating layout?

Get help using Construct 2

Post » Sat Mar 31, 2012 8:53 pm

Hey all, got an interesting question.

At the moment, 8-directional controls always are oriented in the same direction, regardless of rotation of layout. Needless to say, this makes it impossible to use in any games involving rotation of layer/layout.

So, there are two solutions as far as I can see...

-1. Someone comes up with a working replication of the behavior, and then we could apply trig. However, I cannot seem to come up with a good imitation of it.

-2. @Ashley adds an 'Angle Offset' property, which adjusts the control direction of the behavior accordingly.

Any help or advice would be nice!
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Apr 01, 2012 8:46 pm

Did you try custom movement? You can pretty much move anyway you want with custom movement.
B
22
S
5
G
3
Posts: 194
Reputation: 5,855

Post » Sun Apr 01, 2012 8:53 pm

Yeah, but some of the things within 8-directional behavior I can't really seem to figure out, especially the collision with solids.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Apr 02, 2012 2:27 am

I did a quick thing in another example - it was custom movement, I just set the movingangle of the objects custom movement to the angle between the colliding object and the ball object.

The only issue would be if you had a long platform, as it'd go from the wherever the origin was - in which case it'd get a lot more complicated to code. :-/

Download here

http://www.johnnysix.net/games/windex/windex.capx

It is the event where the ball collides with the box.JohnnySix2012-04-02 02:28:45
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt and 33 guests