我终于决定为我的游戏添加任务。我希望任务是彼此独立的。也许以后会有一个人在访问之前完成另一个任务。无论如何。将任务添加到我的游戏
我该如何解决这个问题?我已经想了很多。我是一个PHP/Javascript/Mysqli的家伙。
你跟NPC交谈,如果你选择正确的“答案”,他们将开始任务。你做任务,你可能不得不和其他NPC交谈。这完全取决于。我如何存储对话并显示它们?
谢谢。
编辑
这就是我 “完成”。
var people = [];
people[1]=['name'=>'Joe'];
people[1]['questions'][1] = 'Why, hello there';
people[1]['questions'][1]['send'] = 1;
people[1]['questions'][2] = 'My name is Joe, You seem to be new around here';
people[1]['questions'][2]['send'] = 2;
people[1]['questions'][3] = 'Why certainly! How about I send you on a quest to help you. It will get you aquainted with Corgate';
people[1]['questions'][3]['send'] = makequest(1);
people[1]['answers'][1] = array('Hello, who are you?');
people[1]['answers'][1]['send'] = 2;
people[1]['answers'][2] = array("I'm not new! Good bye!",'Yes I am, Can you help me?');
people[1]['answers'][2]['send'][1] = 3;
people[1]['answers'][2]['send'][2] = endthis();
非常草率。是。基本上,它从问题开始。然后“发送”到该Id的答案。然后,根据选择的答案数组,然后将其发送给相应的问题。
你的第一个任务是将你的尝试纳入到目前为止。 奖励:答案 –
这是一个非常模糊的问题,但我认为你可以通过在gamedev堆栈交换站点http://gamedev.stackexchange.com/上查看周围的东西,以获得其他人可能拥有的一些想法在他们的游戏中实现了任务 – nvuono
提示:对话树是树。 – 2012-05-16 03:17:20