How do I move towards position of another layer?

Get help using Construct 2

Post » Mon Oct 20, 2014 12:01 pm

I have a game where a player collects coins. Each time a coin is collected, particles spawn and I want those particles to move towards the energy meter in the top right. The only problem I have is that the energy meter is on the "UI" layer so it does not move with the camera that follows the player on the "Game" layer.

I have tried moving the particles to the 'UI" layer, but then they never spawn at the proper location since the player is moving. I tried using custom movement and bullet behaviors, but I cannot get an accurate movement path since the coins are not always collected from the same position. Any advice?
B
6
S
1
Posts: 71
Reputation: 548

Post » Mon Oct 20, 2014 6:33 pm

Your not going to be able to accomplish it. At least not in the way your doing it. The problem is the spawned position(coordinates) is always going to be a different coordinates on the UI layer. It's basically a parallax issue. I've tried to make a work around for his but without luck. You can sometimes get close, but not exact. If you or some one else, do come up with a solution, I'll be interested in seeing it
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,273

Post » Mon Oct 20, 2014 7:38 pm

The layer to canvas and canvas to layer expression may work to translate the particle to the hud layer at teh good coordinate, then you just have to move them.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Mon Oct 20, 2014 8:48 pm

B
55
S
29
G
19
Posts: 1,520
Reputation: 25,620

Post » Tue Oct 21, 2014 10:53 am



This worked perfectly and was exactly what i wanted to do. Thanks!
B
6
S
1
Posts: 71
Reputation: 548


Return to How do I....?

Who is online

Users browsing this forum: JaredX, ksiads, Magistross, Rable and 6 guests