gpt4 book ai didi

c++ - 游戏开发 : how should I manage the AI using lua scripts?

转载 作者:太空狗 更新时间:2023-10-29 21:46:33 24 4
gpt4 key购买 nike

我的游戏是用 C++ 编写的,我想让 AI 由 lua 脚本管理,但我不知道脚本应该是什么样子以及在 C++ 中的集成。

脚本应该是这样的

   if (whatever_happening) do_something
if (....) .....
etc

在 C++ 的每一帧中,我都应该调用每个敌人:

   foreach(enemy)
enemy.handleAi(luascript.file)

或者它是错误的,我应该以不同的方式处理它?<​​/p>

最佳答案

要回答关于 AI 脚本应该是什么样子的其他问题,这更适合 gamedev.stackexchange .看看这个问题和答案:https://gamedev.stackexchange.com/questions/2194/new-to-creating-ai-where-to-start

关于c++ - 游戏开发 : how should I manage the AI using lua scripts?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14843410/

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