Dynamic Camera Pan/Zoom based on multiple objects

6

Index

Stats

7,119 visits, 13,565 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 26 Jun, 2017. Last updated 19 Feb, 2019

The Intro

For the recent C3Jam

, I worked on a game called BLU. Its fast-paced strategy platformer with AI enemy bots that use platformer pathfinding. In the game, you control a blue square and try to paint the arena blue, while 3 enemies with different skills and objectives, try to kill you or undo your work. Random power-ups spawn which give your character special abilities for a short time.

Rather than having a static camera showing the view of the entire arena at all times, I wanted the camera to be dynamic to achieve the following objectives:

o Focus on all active objects (player, bots, powerups) at same time

o Zoom in when objects are closer

o Zoom out when objects are apart

o Pan and follow all active objects

The result was something like this...

Subscribe to Construct videos now

You can play the game here

In this tutorial, we will see how this was done.

Pre-requisites

This tutorial builds on top of the concepts explained in another tutorial I had written for "Smooth scrolling with inertia". Please go through that tutorial first and come back here.

  • 3 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • hi abhishan, i saw your platformer pathfinding post, do you still have this construct 2 project? i would love to buy it!

  • I'm definitely going to further review this and see if it's something I can implement into my current or future projects. Your video was very impressive.

    • Thank you for your comment and appreciate you taking the time to read the tutorial!

      I was inspired to develop this while looking at the gameplay footage of the steam game "Sombrero", also made with Construct (2).