• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM Smooth Camera Zooming Out

gdkid

Member
Hi guys

I've made a small game called "Core" on Android.

About gameplay, you control a small square running through endless circle, each time the square lands on a "pad" , it jumps to next circle. Try not to be pulled into the center of the screen and you're OK.

Gameplay :

Download here on Android : https://play.google.com/store/apps/details?id=com.strangepulse.core

However, it has a small problem with a gameplay which I can't figure out a way to solve.

When player lands on many pads for a short time, he jumps too fast that he gets out of the screen. Then he has to wait to see the square again, which affects the game feel.

I try to solve it my zooming camera away, so each time the player's distance to the center exceeds a value, the camera will zoom out. However, it happens suddenly (imagine the game turns small in a blink, then big again), doesn't feel good

Is there anyway to make the transition smoother ?

You can watch the gameplay and download it here

Thank you so much
 

acidemic

Member
Yes, you can by just adding few additional lines of code. Use lerp(a, b, amt) function which would interpolate the zoom level between the current and target one.

Logic would be like in Step event:

Code:
current_zoom = lerp(previous_zoom, target_zoom, 0.5);
previous_zoom = current zoom;
where
current zoom - interpolated zoom which you will show on the screen
previous_zoom - zoom you showed at previous step
target_zoom - the zoom level you are aiming for (the one you are using now)

You can play with the interpolation amount to achieve the desired effect, try also 0.25 or 0.1 instead 0f 0.5 or any other number less that 1 and greater than 0.
 
Last edited:
Top