Swift:在单个视图应用程序中设置游戏场景

时间:2023-01-23 13:07:41

I'm currently attempting to develop games using the sprite kit on a single view application because there is more to my app than a game. I've found this method quite unorthodox because most games are made by directly selecting the game template at the beginning of the project. I have managed to add the sprite kit framework and I've got the fps, draws, node to show. However I've found on native sprite kit projects they have GameScene.sks, and a pre setup GameScene.swift file into their project. How would I set them up? Do I copy the code and put it into a GameScene.swift file and link it to my GameViewController? How would I find and setup the GameScene.sks file?

我目前正尝试在一个单一视图应用程序上使用sprite工具包开发游戏,因为我的应用程序不仅仅是一个游戏。我发现这种方法非常不正统,因为大多数游戏都是在项目开始时直接选择游戏模板来制作的。我已经成功地添加了sprite kit框架,并显示了fps、绘制和节点。但是我发现在本地的sprite kit项目中他们有GameScene。sks,还有一个pre - setup GameScene。迅速提交他们的项目。我该如何设置它们呢?我要把代码复制到游戏中去吗?swift文件并链接到我的GameViewController?我要如何找到并设置这个游戏集。sks文件?

1 个解决方案

#1


2  

Not sure why somebody down voted this question, maybe because the question is not descriptive, but anyway, to create a new scene, on the menu, select File -> New -> File, go to iOS -> Resource, and select SpriteKit Scene, this is will create a new Scene template for you

不知道为什么有人投了这个问题,可能是因为这个问题不是描述性的,但是不管怎样,要创建一个新场景,在菜单上,选择File -> new -> File,进入iOS ->资源,选择SpriteKit scene,这将为您创建一个新的场景模板

#1


2  

Not sure why somebody down voted this question, maybe because the question is not descriptive, but anyway, to create a new scene, on the menu, select File -> New -> File, go to iOS -> Resource, and select SpriteKit Scene, this is will create a new Scene template for you

不知道为什么有人投了这个问题,可能是因为这个问题不是描述性的,但是不管怎样,要创建一个新场景,在菜单上,选择File -> new -> File,进入iOS ->资源,选择SpriteKit scene,这将为您创建一个新的场景模板