我終於決定爲我的遊戲添加任務。我希望任務是彼此獨立的。也許以後會有一個人在訪問之前完成另一個任務。無論如何。將任務添加到我的遊戲
我該如何解決這個問題?我已經想了很多。我是一個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