How do I make my player appear outside my building

Get help using Construct 2

Post » Wed Jul 08, 2015 9:40 am

How do I make my player appear outside my building after I exit it on a separate layout.

So i'm making a 2d game and want to enter and exit 2d buildings. I have 2 layouts and I have made exit boxes, one to enter the building from layout 1 (My level) and appear in layout 2 (inside the building) I know how to enter and exit.
Whats stumping me is that when i get my player to exit layout 2 (inside the building) and return to Layout 1 (My level) The player appears on Layout 1 at the start of the level, I want him to start outside the building where he entered instead of appearing at the start of the level. That might not have been very clear.

Thanks
B
5
Posts: 18
Reputation: 260

Post » Wed Jul 08, 2015 10:01 am

Image Image
B
26
S
15
G
142
Posts: 881
Reputation: 74,060

Post » Wed Jul 08, 2015 10:35 am

Thanks for that, It did help a little but that's quite a complex set of doors. I've made my sprite global which is awesome as i no longer have to place a player at the start of a new level. But when I exit my building, my player is no where to be seen, he might be behind all the layers as i can still move around the screen but I cant see him.

Ahhh Its because he gets destroyed from each layout because hes a global , so after exiting the building hes not there. How do i get him to spawn again.
B
5
Posts: 18
Reputation: 260

Post » Wed Jul 08, 2015 10:46 am

GThreepwood try this tutorial might help you if not click under my profile link it will take you to some tutorial I have created

https://www.scirra.com/tutorials/532/ho ... creen-game
B
257
S
42
G
15
Posts: 1,992
Reputation: 41,425

Post » Wed Jul 08, 2015 10:54 am

Message: GThreepwood is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Lordshiva1948 wrote:GThreepwood try this tutorial might help you if not click under my profile link it will take you to some tutorial I have created


Thanks Lord Shiva, That tutorial is pretty much exactly what i was doing. But I'm making the player overlap the exit box and hold down to exit the building. If the player is set to global, he doesnt reappear but i still have control. If hes not global, he just reappears at the start of the level, not at the position he exited the building from.
B
5
Posts: 18
Reputation: 260

Post » Wed Jul 08, 2015 11:12 am

Thank for the help everyone.

I created a global variable with a value of 0. When exiting my building, 1 is added to the global variable.
On the start of layout for the previous level, I checked the global variable and if it was 1, i positioned the player at the exit box. Your help was incredible. Thanks for the amazing support,
B
5
Posts: 18
Reputation: 260


Return to How do I....?

Who is online

Users browsing this forum: psicodelicow3, Yahoo [Bot] and 3 guests