Portrait endless game

  • Hey guys.

    I'm new to construct 3 and followed some templates to get some idea about the whole process. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

    I have a question about camera view, i mean i need to set my player in the middle and ( sample - ufile.io/pizkh ) scroll background .

    Anyone willing to help me out? Thanks in advance. ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Simply add the "scroll to" behavior to your player.

  • emmazz

    why don't you just use the template C3 has for infinite jumper? and build upon it?

    also what the person above said scroll to behavior or you can do it by events using viewport scroll to position.

  • Simply add the "scroll to" behavior to your player.

    yeah, i tested it. but not working properly. maybe, because of my layout sizes.

    can you please tell me the correct layout sizes and viewpoint for (portrait - vertical) android/ios game ?

  • emmazz

    why don't you just use the template C3 has for infinite jumper? and build upon it?

    also what the person above said scroll to behavior or you can do it by events using viewport scroll to position.

    yeah, i'm stuck at background, because in this template only white background and it's not scrolling with player

  • > emmazz

    >

    > why don't you just use the template C3 has for infinite jumper? and build upon it?

    >

    > also what the person above said scroll to behavior or you can do it by events using viewport scroll to position.

    >

    yeah, i'm stuck at background, because in this template only white background and it's not scrolling with player

    but if u are using a purple bg just give that color to the layout bg, it will be that color forever no matter where ur player is set. also ur player actually does not move outside the screen.... the green blocks move down when player jumps up, creating the illusion the player moves outside the screen. note the screen and layout size is impossible for you to go outside .... however if you want a bg going downwards against the player like clouds and stuff look at the flappin birds tutorial there is a moving bg with a parallax effect just do the same but for vertical whenever player moves or the action for platform blocks moving down the bg should move also but 80% slower

  • >

    > > emmazz

    > >

    > > why don't you just use the template C3 has for infinite jumper? and build upon it?

    > >

    > > also what the person above said scroll to behavior or you can do it by events using viewport scroll to position.

    > >

    >

    > yeah, i'm stuck at background, because in this template only white background and it's not scrolling with player

    >

    but if u are using a purple bg just give that color to the layout bg, it will be that color forever no matter where ur player is set. also ur player actually does not move outside the screen.... the green blocks move down when player jumps up, creating the illusion the player moves outside the screen. note the screen and layout size is impossible for you to go outside .... however if you want a bg going downwards against the player like clouds and stuff look at the flappin birds tutorial there is a moving bg with a parallax effect just do the same but for vertical whenever player moves or the action for platform blocks moving down the bg should move also but 80% slower

    Hi, thank you for your reply

    for the honest, i need to make android game (endless) same as this one. [quote:304k2kyn]https://www.youtube.com/watch?v=OxOpZ69RI24

    so i created 4 backgrounds ( 4 layers) and bottom background fixed and other 3 (transparent) with 3 different scrolling speeds (same as video). so how do i set it to scroll ?

    can you please give me hint to create it ?

  • you can use tiled backgrounds

    background.Y = background.Y + scrollspeed

    if background.Y > 600 then reset background.Y to starting position

    That is literally all you need, just change numbers ( Y position ) to fit your game, I put 600 as an example only. That number will have to be a multiple of your tile height so it's not visible when you switch back to starting Y

    for backgrounds farther away it would be:

    background2.Y = background2.Y + scrollspeed*0.75

    background3Y = background3.Y + scrollspeed*0.5

    or up to you how much of a speed difference you want and of course, like the top background you reset each to their starting Y position once they scroll beyond certain point

  • can you please give me hint to create it ?

    easiest way to create a parallax bg is to use bullet behavior on your tilebg give it a 40 speed or 20 set movement angle to 90 on start of layout. (tilebg needs to have double screen size when you place it that means is going to see 2 times the length of screen outside and be seamless), set tilebg origin point to down center.

    once you done the above create a condition : tilebackground y >= self.height set Y to 0

    and thats it. you will have to tweak around the speed and background size till it works for your screen size/screen speed.

  • Hi emmazz,

    This c3p can help you, I created it for joelmayer on Constructive.

    Scrolling is background "parallaxed" in the simplest way possible.

    I invite you to change it vertically, it's very simple to achieve. <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    https://cdn.discordapp.com/attachments/ ... rallax.zip

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