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
13
S
4
G
1
Posts: 101
Reputation: 2,389

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
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,418
Reputation: 57,673

Post » Thu Dec 19, 2013 1:02 am

I got an error, "Dx Unknown Expression"
B
13
S
4
G
1
Posts: 101
Reputation: 2,389

Post » Thu Dec 19, 2013 1:09 am

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

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).
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,418
Reputation: 57,673

Post » Thu Dec 19, 2013 2:42 am

It works perfectly! Thanks so much!
B
13
S
4
G
1
Posts: 101
Reputation: 2,389

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,426

Post » Thu Dec 19, 2013 12:02 pm

@Jannesalfa - Good question. I like a challenge so I'm going to make a quick tutorial!
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,418
Reputation: 57,673


Return to How do I....?

Who is online

Users browsing this forum: PitfallJerry and 1 guest