0 Favourites

Camera Zoom compared to the distance of player to the wall

  • 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

    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

  • I made a tutorial about something similiar here :

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

  • I made a tutorial about something similiar here :

    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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)