How do I move to different layouts?

Get help using Construct 2

Post » Tue Jun 23, 2015 9:17 am

Hello everyone I just have a simple question how do I move the character to the different layout. Currently I made in the MAP1 sprite that when you collide with it, it sets the MAP2 layout.

The sprite that when you collide with it, it will move you to the MAP2 and if you go back it will bring you back to the MAP1. Also how to make it smooth? By smooth I mean if you collide with the sprite which is on the right hand side you will spawn on the MAP2 on the left hand side! :|

Big thanks to everyone for any help!
B
8
S
3
Posts: 120
Reputation: 989

Post » Tue Jun 23, 2015 9:23 am

Do you mean?

Map 2

on start of layout - player set position
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 Jun 23, 2015 9:31 am

I mean like when you collide with the yellow spite it will move you to the MAP2 and make it look like you just came out from the left not just spawn in the middle of the map. Thanks for replying!
MAP1
Image
MAP2
Image
B
8
S
3
Posts: 120
Reputation: 989

Post » Tue Jun 23, 2015 9:43 am

on map 1 event sheet add the event

On collision with layoutchanger
> system goto layout "Map2"

on map 2 event sheet add the action

on start of layout
> player set position (add the coordinates)

If the player doesn't exist on map 2, either set it to global, or use a system create player action..
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 Jun 23, 2015 10:11 am

B
8
S
3
Posts: 120
Reputation: 989

Post » Tue Jun 23, 2015 10:20 am

Frap1K wrote:Hmm I'm doing something wrong :/
https://www.upload.ee/files/4795992/MAP ... .capx.html


That's why I said:

LittleStain wrote:If the player doesn't exist on map 2, either set it to global, or use a system create player action..
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 Jun 23, 2015 10:30 am

You mean set the global Variable for the Players X & Y ?
B
8
S
3
Posts: 120
Reputation: 989

Post » Tue Jun 23, 2015 10:35 am

Select the player sprite and in it's (object type) properties set Global to yes..

Or........

On start of layout
> system create object player at x=whatever, y=whatever

but setting the player to global would be the best choice..
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 Jun 23, 2015 10:37 am

Oh it worked so basically all I had to do was player set to global YES! It works one way now!
But I have to do the same other way? or Ill need to use something else? So I can get back to Map 1.

Sorry this is my first time doing this...
B
8
S
3
Posts: 120
Reputation: 989

Post » Tue Jun 23, 2015 10:39 am

I guess you would have to know if the player came from Map 2 on start of layout Map 1 or else the player would always start at the exit..

setting a global variable (or an instance variable on the player) to layoutname before changing layouts and checking it on start of the new layout would do the trick..
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

Next

Return to How do I....?

Who is online

Users browsing this forum: ratboy3 and 42 guests