Coins count effect

Discussion and feedback on Construct 2

Post » Fri Feb 17, 2012 6:58 pm

I think that all of you have seen this effect in a platformer games.
When player touches the coin, it begins to move the coin's counter.

So i tried to make something like this and it didn't work %(

Here is my events:


The problem is that when player contact with the coin, this coin is removed and new one created on layer "interface" in which parallax = 0.

So i need way to express coins coordinates relative to the "interface" layer.
B
38
S
15
G
6
Posts: 238
Reputation: 7,780

Post » Fri Feb 17, 2012 7:11 pm

why dont you spawn the coin on the layer that uses the right paralax setting?
B
43
S
19
G
13
Posts: 723
Reputation: 14,535

Post » Fri Feb 17, 2012 7:23 pm

[QUOTE=Weishaupt] why dont you spawn the coin on the layer that uses the right paralax setting?[/QUOTE]

What do you mean "right paralax setting"?
B
38
S
15
G
6
Posts: 238
Reputation: 7,780

Post » Fri Feb 17, 2012 7:36 pm

spray the coins using the particle system =]
ImageImageImageImageImageImage
Image
B
98
S
21
G
16
Posts: 1,338
Reputation: 21,122

Post » Fri Feb 17, 2012 8:00 pm

@Vladoss
Instead of destroying and re-creating the coin you can just use the "move to layer" action.

Then here is the math you're looking for to move the coin to a location on the parallax 0,0 layer that is visually the same as the scrolling layout.

coin | set position to (self.X-scrollx+WindowWidth/2, self.Y-scrolly+WindowHeight/2)
B
85
S
27
G
77
Posts: 5,006
Reputation: 53,746

Post » Fri Feb 17, 2012 8:03 pm

[QUOTE=R0J0hound] @Vladoss
Instead of destroying and re-creating the coin you can just use the "move to layer" action.

Then here is the math you're looking for to move the coin to a location on the parallax 0,0 layer that is visually the same as the scrolling layout.

coin | set position to (self.X-scrollx+WindowWidth/2, self.Y-scrolly+WindowHeight/2)[/QUOTE]

That's exactly what I needed! Thank you!
B
38
S
15
G
6
Posts: 238
Reputation: 7,780


Return to Construct 2 General

Who is online

Users browsing this forum: sizcoz, The Mnk and 6 guests