- Home /
The question is answered, right answer was accepted
How to organize challenge system?
Hi,
I am trying to devise a type of level challenge system(i.e. "complete level without healing", "kill all enemies" etc ) for a small RPG-like game. For each level, 3 challenges are randomly chosen from a list. Ideally, when a level is entered, those 3 are added to their own list or dictionary and their completed bools checked when conditions are met, and compared when rewards are eventually doled, then that list cleared for the next level.
Here is my challenge class:
[System.Serializable]
public class Challenge
{
public string name;
public GameObject reward = null;
public int rewardCount;
public bool completed = false;
}
The problem I face is the best way to store these 3 challenges and access them throughout the level to update their completion status. The class that updates their status would need to know which challenges were chosen and how to locate and update them (key?) if they were. Therefore, Is a dynamically generated dictionary my only recourse according to these needs?
I appreciate any advice on this.