Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

联机游戏的后端如何使用cocos的物理引擎 #35

Closed
liujin1993 opened this issue Oct 5, 2022 · 2 comments
Closed

联机游戏的后端如何使用cocos的物理引擎 #35

liujin1993 opened this issue Oct 5, 2022 · 2 comments

Comments

@liujin1993
Copy link

如题想请教下,用cocos写单机游戏的时候可以使用其自带的物理引擎,各个物体的位置都是由物理引擎计算的,而联机游戏需要前后端共用一套逻辑,这时后端如何使用cocos的物理引擎呢

@k8w
Copy link
Owner

k8w commented Oct 7, 2022

好问题,一般来说有几种方式。

  1. 采用主机模式,主机跑在浏览器里,就可以完整运行 Cocos 游戏逻辑。(变种方法是尝试 Pupeteer 这样的 Headless 浏览器,让浏览器以无渲染模式跑在 Server)
  2. 不使用 Cocos 的物理引擎,而是将完整的游戏逻辑,单另实现。

@liujin1993
Copy link
Author

学到了!3q!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants