什么是无尽的赛跑游戏的一般架构? [英] What is the general architecture of an endless runner game?

查看:146
本文介绍了什么是无尽的赛跑游戏的一般架构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感到困惑的是无尽的赛跑游戏的实际工作,在概念上,就像一个无尽的画布。 Sprite Kit在NDA下,所以我将使用Cocos2D作为我的框架。

I am confused as to how endless runner games actually work, conceptually, as far as having a never-ending canvas. Sprite Kit is under NDA, so I am going to use Cocos2D as my framework.

有一些教程专门针对其他语言和工具,我只需要弄清楚基本上:如果我创建一个具有特定大小的场景,我如何创建一个永无止境的背景的错觉?我只是动画背景后面的场景,或者我不知何故动态添加长度的场景,所以我的跑步者真的是沿着画布运行?

There are some tutorials on the web that are specific to other languages, and tools, but I just need to figure out basically: If I create a scene with a specific size, how do I create the illusion of a never-ending background? Do I just animated backgrounds behind the scene, or do I somehow dynamically add length to the scene, so my runner really is running along the canvas?

我有意义吗?我只是不能掌握这些游戏使用的实际方法是什么。他们肯定觉得赛跑者精灵正在沿着画布移动,但也许只是因为他仍然保持静止,所有的元素都在移动。

Do I make sense? I just cannot grasp what the actual method these games use is. They certainly feel like the runner sprite is moving along a canvas, but maybe it's just that he's staying still and all the elements are moving?

推荐答案

您可能希望有两个背景节点,每个节点的大小比屏幕尺寸大一些(可能是1.5或2)屏幕宽度)。
当你加载你的关卡,你加载第一个背景和添加第二个背景在坐标的第一端,使他们形成长屏幕。然后,当我们开始沿着这个背景移动字符时,第一个背景离开屏幕,我们可以采取它,并将其坐标改变为第二个背景帧结束的那些。这种方式,当这到了结束,我们做同样的。
这种方式只使用2个长图像,我们可以模拟本质上无尽的空间。
你可以为你的游戏使用更长的序列。
当你离开屏幕并呈现它时,你可以添加其他节点到你的背景,所以每次看起来都不一样。

You might want to have two background nodes, each larger than the screen size by some amount (maybe 1.5 or 2 screen widths). When you load your level, you load first background and add second background at the coordinates where first ends, so that they form long screen. Then when we start moving character along this background when first background leaves screen we can take it, and change its coordinates to those where second background frame ends. This way when this comes to an end, we do the same with it. This way only using 2 long images we can simulate essentially endless space. You can use longer sequences for your game. You can add other nodes to your background when it has left the screen and present it, so it looks different each time.

这篇关于什么是无尽的赛跑游戏的一般架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆