How do i make a Local Co-op...

Get help using Construct 2

Post » Sun Sep 01, 2013 12:43 am

How do I create a Local Co-Op in my game that players can not be too far from each other? Sorry for my Bad English ...

Ah, the game is platform.
B
9
S
1
Posts: 75
Reputation: 1,118

Post » Sun Sep 01, 2013 3:03 am

You can use two (or more) diferent objects with Plataform Movement behavior, remove the default control, and assign diferent controls to each player. To keep them from moving too far from each other and to keep both of them on screen you can create an object just to be the "camera" and apply the Scroll To behavior and always set the position of the camera to middle point between the two players (or more than two): camera.x = (player1.x + player2.x)/2
And to keep them to moving out of the screen you can create two walls as Solid objects and set the position of the walls as camera.x - viewport.width/2 and camera.x + viewport.width/2...
Hope I was clear enough... =S
B
4
Posts: 8
Reputation: 354

Post » Sun Sep 01, 2013 4:15 am

[quote]You can use two (or more) diferent objects with Plataform Movement behavior, remove the default control, and assign diferent controls to each player. To keep them from moving too far from each other and to keep both of them on screen you can create an object just to be the "camera" and apply the Scroll To behavior and always set the position of the camera to middle point between the two players (or more than two): camera.x = (player1.x + player2.x)/2[/quote]

it's worked, but...
And to keep them to moving out of the screen you can create two walls as Solid objects and set the position of the walls as camera.x - viewport.width/2 and camera.x + viewport.width/2...
Hope I was clear enough... =S

i not understand, what is "viewport.width/2"? i can't make this

and how to make to the camera follow players in Y? I tried the same way as with the X, but it did not work.DFox2013-09-01 04:17:43
B
9
S
1
Posts: 75
Reputation: 1,118

Post » Sun Sep 01, 2013 9:22 am

In the event sheet it would look like this:

system every tick - wall set x - camera.x - viewport.width/2

to make the camera follow in y:

system evers tick -camera set position - x = (player1.x + player2.x)/2, y = (player1.y + player2.y)/2


system every tick - system scrollto - cameraLittleStain2013-09-01 09:27:49
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 » Sun Sep 01, 2013 5:05 pm

I have this problem:

"'Viewport' is not a object name"
I need create other object named viewport?
The Camera Works!
B
9
S
1
Posts: 75
Reputation: 1,118

Post » Mon Sep 02, 2013 7:19 am

You're absolutely right, sorry..

Replace viewport.width with:(

ViewportLeft("Layer 0")+ViewportRight("Layer 0"))/2

to get the real center.
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 » Mon Sep 02, 2013 7:29 am

So you could just place the walls at x: viewportleft("layer") and viewportright("layer")

to prevent moving too far apart.
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 » Mon Sep 02, 2013 10:57 pm

Something is wrong ... I wanted it to be one left and one right, not to the medium, as is (http://i.imgur.com/8TDPKZO.png). So that players were unable to get very far away from each other (out of the screen)
B
9
S
1
Posts: 75
Reputation: 1,118

Post » Mon Sep 09, 2013 1:38 am

Please i need help :v
B
9
S
1
Posts: 75
Reputation: 1,118

Post » Mon Sep 09, 2013 3:36 am

the best way to place the walls is just to put them on a parallax 0 layer =)
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Next

Return to How do I....?

Who is online

Users browsing this forum: ST314 and 35 guests