how to create a mission

I want to create different missions for my game. I thought I would create a class for each mission. Each class implements an interface so you can insert the missions in a list. It 'just as reasoning?

A sub-class per mission sounds good to me. Each mission would implement the success or failure condition. Not sure why you need to store them in a list thought (I am assuming exacly one mission per scene).

Got to make sure you have your game design pinned down before we can help on this. Some considerations:

  • Are missions one per level?
  • How many missions can be active at once?
  • Can a player have no missions?
  • Can a mission be failed? Partially succeeded?
  • How does a player get new missions?
  • How many missions are there in the game?

The answers to these and other design considerations will effect how you code things.

1 Like

my game is for mobile. The layer is created at runtime and each game matches a random mission. To do that Iā€™m working out with the technique mentioned above

Consider making missions data driven instead of hard-coded in separate classes. It takes a little more planning up front, but it will make life much easier down the road.

1 Like