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

  • 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.

  • 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

  • ou 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

    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.

  • 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 - camera

  • I have this problem:

    "'Viewport' is not a object name"

    I need create other object named viewport?

    The Camera Works!

  • You're absolutely right, sorry..

    Replace viewport.width with:(

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

    to get the real center.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So you could just place the walls at x: viewportleft("layer") and viewportright("layer")

    to prevent moving too far apart.

  • 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)

  • Please i need help :v

  • the best way to place the walls is just to put them on a parallax 0 layer =)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)