Transition between multiple Camera2D nodes.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By 9BitStrider
:warning: Old Version Published before Godot 3 was released.

I’m thinking that I can use multiple Camera2D nodes to simulate classic Megaman’s “room” structure from the NES games. However, I’m not entirely sure how I would transition from one node to another (where the player touches the edge of the screen, then the next room slides over into view). Any ideas?

:bust_in_silhouette: Reply From: eons

I have tried something like that, is not hard, what you need is a single camera, and targets spots for transition.

Add a series of “area limits” to your level, when the player touches it, translate the camera to the next section start point, the new section should re-define the limits of the camera, until a new limit is reached.

Start with simple screen transition (tweens can help on moving the camera and translating a bit the player, areas and segment shapes to trigger change), then play with camera limits.

Are there any examples of this that I could reference? My code spits back errors no matter what I do. Lol.

9BitStrider | 2017-08-26 22:28

I don think so, is too specific and my crappy tests are on a dead drive now.

But start with simple stuff, write and draw on paper the things you want to do, the first is to make a camera move from one point to another on area enter.

Then link those points with variables (as you would do with teleports, to mention something similar), when the important node enters one area, the camera is moved to the point linked for transition.

Start with dirty code, then simplify with tweens to take care of the motions.

In the end, your level could be a single map/tilemap with special transition areas linked to a landing point for the camera.
Each section could be its own tilemap/scene too if you want to work in chunks, be creative ^^

eons | 2017-08-27 21:00