How do I stop the camera to be centered on player

Get help using Construct 2

Post » Wed Sep 28, 2016 6:52 pm

Hi

Im using a custom camera with lerp scrollx and scrolly to playerx and playery. It works nicely. Now my biggest issue is to achieve the camera the way I want.

I have set my window size to 320x200. I like to keep the player at a low height, kinda like a Super Mario feel. Now the problem is if I have a big layout the camera will get right in the center of the screen. Not sure if I make myself clear.

This is what I want:

Image

Keeping the character about that height on the screen. That's because the Layout size is about the same as the screen size.

This is what I get when I increase the layout size:

Image

I do not like the way it looks and I can't seem to find a way to keep it always look like image #1 even if the layout is big.

Any tips?
B
14
S
5
Posts: 252
Reputation: 1,713

Post » Wed Sep 28, 2016 7:04 pm

Maybe something like:

ScrollY = player.Y - 60
Find all the Construct 2 games that were on Steam Greenlight here
B
36
S
10
G
7
Posts: 477
Reputation: 7,019

Post » Wed Sep 28, 2016 7:04 pm

https://www.youtube.com/watch?v=TCIMPYM0AQg

Is a gold mine of information regarding camera logic.

Basically, you do not want to use scrollto on your player object. You'll be using an invisible helper sprite, lets call it "camera" and scrollto that. You will be moving the camera object around with constraints (min(), max(), and clamp()) based on player position and your preferred logic.

But from the video you can see how much consideration goes into having excellent viewport camera logic.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Wed Sep 28, 2016 8:18 pm

Thanks for the answer, specially @oosyrag

Would like to listen to more suggestions!
B
14
S
5
Posts: 252
Reputation: 1,713

Post » Wed Sep 28, 2016 10:09 pm

More info from the creator of that video. http://blog.mimeoverse.com/post/5814677 ... d-minimize
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests