How do I Move Player to new layer and set position.

Get help using Construct 2

Post » Wed Aug 26, 2015 12:59 am

I've already set the player to move to a new layer on button press and when collides with a door, but when it happens, the player is underneath the next layer in question.
I also experimented with setting the position (Or, teleporting, in my mind.), so maybe I could just make all the rooms in one layer, but it doesn't seem to work every time I try to use the 'set position' in any context...
For the re-position I've tried,
Player - On collide with Space down, set player position.
Anyway, doesn't seem to work and its hard to find a tutorial on anything.
I'm trying to make a game that's sort of like a life sim, but heavily exaggerated with guns, enemies, and different forms of game play. Its sort of like the life sim of the 8 bit era. Most of the game is exploring the environment with 4 - way movement. But, once you get out of the initial town, the game will turn into a 2D platformer with random events breaking it up like oergon trail. But once in a town or event and its 4 way movement again.
Anyway, right now I'm just working on the house the player lives in, and then maybe the first over world town.
B
6
S
1
Posts: 29
Reputation: 408

Post » Wed Aug 26, 2015 3:24 pm

Maybe try using a Player: Move to top of layer (z-layer). Although changing layers does that inherently...

Try building a capx to text exactly your issue. If you can rebuild it, it will give you insights into the mechanics at work behind the scenes. This general practice has helped me fix many bugs in my game (in fact, I have an entire folder filled with test capx files).
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Wed Aug 26, 2015 8:46 pm

Capx?
Elaborate.
Now, set position is working, but the player is still underneath the layer.
B
6
S
1
Posts: 29
Reputation: 408

Post » Wed Aug 26, 2015 9:11 pm

@justintime0185 Capx is just a Construct2 project saved as a single file.

you say you are already moving the player to a new layer... if you are sure he is on the correct layer, then try setting him to the top of the z-order as well... if he is still behind something, then those objects are not on the layer you think they are (or the player isn't).
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Tue Sep 01, 2015 9:49 pm

justintime0185 wrote:Capx?
Elaborate.
Now, set position is working, but the player is still underneath the layer.


Oops, sorry, I forgot not everyone uses the Windows extensions visible options.

Yea, like @AllanR says, there are Z-layers within each layer and that arranges sprites within a layer, so moving to top of layer should work too, but moving sprites between layers automatically puts them on top the Z-layer of the target layer.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Sat Sep 26, 2015 3:09 am

Yeah I tried all that. Didn't work. I think it was some sort of glitch. Anyway, started a new projected and have learned a lot more.
B
6
S
1
Posts: 29
Reputation: 408


Return to How do I....?

Who is online

Users browsing this forum: dop2000, namaewayukidesu and 7 guests