gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 04:46:24 27 4
gpt4 key购买 nike

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

所以我的问题就像上面的标题一样。我几乎尝试了所有方法,并在互联网上到处搜索。我尝试过的一些伪线索是 .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_left 来定义它。 , limit_top , limit_rightlimit_bottomCamera2D .将它们设置为要限制 Camera2D 的矩形的边界到。


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

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

关于godot - 如何在我的 Godot 游戏中添加 Mega Man、The Legend of Zelda 和 Metroid 等游戏的滑动过渡?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68809951/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com