How do I make a smoth zoom out like nanaca crash?

Get help using Construct 2

Post » Wed Jan 18, 2017 10:50 pm

Does anyone have any tips on making a smooth zoom out/layout scale like the game, nanaca crash?

The problems I'm having are:
1) Keeping the layout stuck to the bottom.
2) Zooming out smoothly as the player moves up.

I think I could solve this the hard way, but I was wondering if there are some standard ways of doing this that I'm not aware of.

Thanks :)
B
8
S
1
Posts: 6
Reputation: 369

Post » Thu Jan 19, 2017 12:18 am

Clamp() the scroll, and lerp() the zoom.
Image ImageImage
B
169
S
50
G
174
Posts: 8,322
Reputation: 110,788

Post » Thu Jan 19, 2017 8:46 am

Thanks for the reply, newt. I had no idea about the clamp function. That should work nicely.
B
8
S
1
Posts: 6
Reputation: 369

Post » Thu Jan 19, 2017 10:19 am

How exactly do you use clamp? What does it do?
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093

Post » Thu Jan 19, 2017 2:52 pm

Something like clamp(lerp(scroll.y,projectile.y,scrollspeed*dt),minyscroll, maxscrolly)
It clamps the y between the minimum, and maximum values.
Image ImageImage
B
169
S
50
G
174
Posts: 8,322
Reputation: 110,788

Post » Thu Jan 19, 2017 11:34 pm

newt wrote:Something like clamp(lerp(scroll.y,projectile.y,scrollspeed*dt),minyscroll, maxscrolly)
It clamps the y between the minimum, and maximum values.


Can you make a .capx example of how this would look like? That game mentioned isn't 'doing it for me' and I would like to know how the clamp and lerp actions are used.
B
216
S
119
G
8
Posts: 141
Reputation: 21,458

Post » Fri Jan 20, 2017 12:12 am

https://dl.dropboxusercontent.com/u/666 ... anaC2.capx
The zoom would be based on the distance to either the top or the bottom, and would work pretty much the same clamp(lerp()).
Image ImageImage
B
169
S
50
G
174
Posts: 8,322
Reputation: 110,788

Post » Sat Jan 21, 2017 8:09 pm

Thanks for the example, newt. You're awesome.
B
8
S
1
Posts: 6
Reputation: 369

Post » Sat Jan 21, 2017 10:16 pm

You're welcome.

A lot of nostalgia for that game.
Image ImageImage
B
169
S
50
G
174
Posts: 8,322
Reputation: 110,788


Return to How do I....?

Who is online

Users browsing this forum: beohs, brunopalermo and 12 guests