Camera Zoom compared to the distance of player to the wall

Get help using Construct 2

Post » Sun Jul 10, 2016 4:44 pm

hello everyone I have spent the a day trying to create a top down game where the camera zoom out when the player is in a open area and zooms in in confined spaces a good example of what I am talking about would be teleglitch https://www.youtube.com/watch?v=Odr-rXYHIHU
I made a prototype where the player is constantly making bullets and when the bullet hits a wall it sets the zoom to the distance between the object and the wall
Distance(Player.x,Player.y,Sprite2.x,Sprite2.y)/50
of course this makes the zoom far away when the player next to a wall and zoomed in when far away from a wall this is the opposite of what also I am using Magicam to control the zoom of my camera but this is very glittery does anyone know how to make a smooth zoom
plugin-magicam-for-c2-alpha-6-5-1-8-14_t74513
B
14
S
4
Posts: 125
Reputation: 1,385

Post » Mon Jul 11, 2016 1:42 am

I made a tutorial about something similiar here :
https://www.scirra.com/tutorials/4795/h ... n-one-line
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
64
S
14
G
2
Posts: 291
Reputation: 6,666

Post » Mon Jul 11, 2016 9:47 am

Are your levels dynamic/random or could you simply have a series of sprites over the different areas - when the player overlaps an 'inside sprite' you set the zoom to your desired level (using something like what puntodamar linked to above) and if they overlap an outside sprite you set the zoom to a much larger value. Although this is a bit binary, it would probably be a lot less stressful for the device performance wise.
B
13
S
6
Posts: 130
Reputation: 1,553

Post » Mon Jul 11, 2016 8:29 pm

puntodamar wrote:I made a tutorial about something similiar here :
https://www.scirra.com/tutorials/4795/h ... n-one-line

very useful thank you
and TMAJA you are right that would be the easiest option but I really liked the way the camera constantly moved in teleglitch depending on where you were looking it was very dramatic
B
14
S
4
Posts: 125
Reputation: 1,385


Return to How do I....?

Who is online

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