What is the purpose of this?

Get help using Construct 2

Post » Tue Sep 23, 2014 12:28 pm

Was looking in the RTS example and found this:

Image

What is the purpose of ("Bases") at the end of Mouse.X and Mouse.Y, Doesn't recall haven't seen it before. And reading the rest of the code doesn't make it any clearer why and what this is used for.

Anyone knows?
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Tue Sep 23, 2014 12:49 pm

The addition of ("Bases") makes the x and the y based on the layer Bases..

If you have more layers than one and the paralax or scale of those layers are different x and y values can get troublesome, for they differ between the layers.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 23, 2014 12:51 pm

"Bases" is an object. You seem to be assigning the X/Y coordinates to the location of "Bases."
What's the URL of the RTS example?
B
21
S
6
G
3
Posts: 55
Reputation: 2,926

Post » Tue Sep 23, 2014 12:55 pm

LittleStain wrote:The addition of ("Bases") makes the x and the y based on the layer Bases..

If you have more layers than one and the paralax or scale of those layers are different x and y values can get troublesome, for they differ between the layers.

Ok that makes perfect sense, thanks :)
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Tue Sep 23, 2014 12:55 pm

frn2000 wrote:"Bases" is an object. You seem to be assigning the X/Y coordinates to the location of "Bases."
What's the URL of the RTS example?


"Bases" in this example isn't an object. It's the name of the layer this action should get the x and y - coordinates from.

This only works for mouse and touch, as far as I know..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 23, 2014 1:00 pm

LittleStain wrote:
frn2000 wrote:"Bases" is an object. You seem to be assigning the X/Y coordinates to the location of "Bases."
What's the URL of the RTS example?


"Bases" in this example isn't an object. It's the name of the layer this action should get the x and y - coordinates from.

This only works for mouse and touch, as far as I know..


cool, thanks for the correction... anyone got the URL of this RTS example?
B
21
S
6
G
3
Posts: 55
Reputation: 2,926

Post » Tue Sep 23, 2014 1:48 pm

Its in the construct 2 examples when you start a new project just type RTS in the search bar and it will show up as a template.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848


Return to How do I....?

Who is online

Users browsing this forum: matriax, zenox98 and 11 guests