如何在我的 Godot 游戏中添加 Mega Man、The Legend of Zelda 和 Metroid 等游戏的滑动过渡?

How do I add the sliding transitions in games such as Mega Man,The Legend of Zelda, and Metroid in my Godot game?

抱歉,问题标题太长了。我是新来的。

所以我的问题就像上面的标题一样。我几乎尝试了所有方法,并在互联网上到处搜索。我尝试过的一些伪线索是 .linear_interpolate("my screen width" , "my screen height) 或什至检查其他人的代码并研究它并可能寻找使用它的方法。

我想要完成的是至少允许玩家在较大关卡的一部分周围移动,将相机向上滚动到关卡的边界,然后使用补间将相机滚动到同一场景的另一个边界,然后依此类推。

我什至不需要补间的全部内容,我只需要一种实现 Camera2D 边界的方法,它允许我实现补间节点来完成它。

请帮忙!

I don't really even need the whole thing with tweens all I need is a way to implement Camera2D bounds that allow me to implement a tween node to complete it.

限制 Camera2D 是比较容易的部分。要么相机根本不跟随玩家(例如 NES 的 Zelda),在这种情况下你只需要补间。

或者……

What I'm trying to accomplish is at least allowing the player to move around part of a larger level scroll the camera up to that bound of the level then scroll the camera using tween to another bound of the same scene and so on and so forth.

摄像机跟随玩家,直到达到某些限制......您可以使用 limit_leftlimit_toplimit_rightlimit_bottom 的属性定义 [= =10=]。将它们设置为要将 Camera2D 限制为的矩形的边界。


我提醒您,Camera2D 达到极限并不是触发过渡的原因。应该触发转换的是玩家角色达到极限......你可以用 Area2D 来处理这个问题,因为玩家角色 - 通常 - 是一个物理对象。

因此,您将处理 Area2D 的信号,并在那里更新相机限制,执行您需要的任何补间,或者任何情况。