paixmaniac's Recent Forum Activity

  • Hi there,

    After a lot of trial and error, I think I made some progress.

    At the end I used CanvasToLayer and LayerToCanvas functions.

    Here is an example line I used to find the position of background sprite on drawing canvas:

    X = CanvasToLayerX("Canvas",LayerToCanvasX("BgBushes", Self.x, Self.y) ,LayerToCanvasY("BgBushes", Self.x, Self.y)) - varDX * (LayerParallaxX("BgBushes") / 100) + (ViewportWidth("Canvas") / 2) Y = CanvasToLayerY("Canvas",LayerToCanvasX("BgBushes", Self.x, Self.y) ,LayerToCanvasY("BgBushes", Self.x, Self.y)) - varDY * (LayerParallaxY("BgBushes") / 100)

    Parallax works on split screen now. But when player 1 moves and jumps, background sprites on Player 2's screen moves a little. This is a bit annoying but I think I can live with that. Afterall this is not a game to be released. I'll try to fix that later.

    Here is the latest project file if anyone is interested.

    I also added zoom. Trying to fine tune it.

    Also I need to fix the split screen bug that happens when Player 1 moves close to edges of layouts.

    I know I can prevent it by blocking player from getting close to edges. But I'think there might be another solution without sacrificing the layout space. Also when zoom is in the equation things get weirder.

  • Uh oh.. Apparently the dropbox link was wrong.

    Here is the working link to project file.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    I'm trying to make a 2 player, split screen platformer to play with my daugther.

    I used Give me a Pixel's tutorial to achieve the split screen effect.

    Everything seems to work fine, except the background layers with different parallax setting.

    I have 6 background layers with different x and y parallax rates.

    I have a canvas object on screen, that covers the right half of the viewport.

    On each frame the I move the objects to canvas position:

    System Set varDX to Player2.X - Player1.X

    System Set varDY to Player2.Y - Player1.Y

    BgBushes Set position to (Self.X - varDX + (ViewportWidth("Canvas") / 2), Self.Y - varDY)

    DrawingCanvas Paste object BgBushes with effects

    And after I paste the object on to canvas, I move the objects back to their positions.

    BgBushes Set position to (Self.X + varDX - (ViewportWidth("Canvas") / 2), Self.Y + varDY)

    As a result, It pastes the background layers to canvas but ignores the parallax values.

    I can't figure out how to calculate the parallax values to move the objects into correct position before pasting them on canvas.

    I've uploaded the project file to dropbox.

    I would appreciate if anyone could help me figure out how to fix this problem.

    Thanks in advance.

paixmaniac's avatar

paixmaniac

Member since 5 Oct, 2019

None one is following paixmaniac yet!

Trophy Case

  • 5-Year Club
  • Email Verified

Progress

6/44
How to earn trophies