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: 248
Reputation: 1,705

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
33
S
9
G
7
Posts: 451
Reputation: 6,782

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
52
S
26
G
110
Posts: 1,619
Reputation: 62,159

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: 248
Reputation: 1,705

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
52
S
26
G
110
Posts: 1,619
Reputation: 62,159


Return to How do I....?

Who is online

Users browsing this forum: khelaghor and 39 guests