Shadow position and angle?

Get help using Construct 2

Post » Thu Dec 19, 2013 12:30 am

Hi,

I need help with the pin behavior. I would like the plane's shadow to follow the plane while staying below it. How can I achieve this effect?


example and capx
B
12
S
4
G
1
Posts: 100
Reputation: 2,362

Post » Thu Dec 19, 2013 12:37 am

Don't bother with pin behavior for this.

Every tick - set shadow position to plane.x + dx, plany.y + dy
           - set shadow.angle = plane.angle

That should do it.Colludium2013-12-19 02:17:42
A big fan of JavaScript. Image Image
B
76
S
20
G
81
Posts: 2,347
Reputation: 50,188

Post » Thu Dec 19, 2013 1:02 am

I got an error, "Dx Unknown Expression"
B
12
S
4
G
1
Posts: 100
Reputation: 2,362

Post » Thu Dec 19, 2013 1:09 am

@Colludium dx and dy??
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Thu Dec 19, 2013 1:20 am

@Joannesalfa and @ThunderLion:

Sorry - not clear at all! I meant delta x and delta y as in your intended displacement for the shadow from the plane.

For example:
every tick, set shadow position to: plane.x + 10, plane.y + 10
The above would put the shadow to the bottom right of the plane (by just over 10 pixels straight line).
A big fan of JavaScript. Image Image
B
76
S
20
G
81
Posts: 2,347
Reputation: 50,188

Post » Thu Dec 19, 2013 2:42 am

It works perfectly! Thanks so much!
B
12
S
4
G
1
Posts: 100
Reputation: 2,362

Post » Thu Dec 19, 2013 6:41 am

@Colludium Talking about the improvement, What's about we can implement a sun which relate to shadow position?
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Thu Dec 19, 2013 12:02 pm

@Jannesalfa - Good question. I like a challenge so I'm going to make a quick tutorial!
A big fan of JavaScript. Image Image
B
76
S
20
G
81
Posts: 2,347
Reputation: 50,188


Return to How do I....?

Who is online

Users browsing this forum: mekonbekon and 10 guests