Skip to main content
GameDev.net gamedev.net
🔒 Locked

Making multiple storylines/characters/modes for one game

Started by RezonAce Feb 3, 2011 at 1:33 AM 2 replies 1k views
Original Post
RezonAce
RezonAce
Now that I have a semi-decent battle system up and running, I want to move on to the next item on my list-multiple characters. The only problem is, each character in my game has their own storyline to follow. So, what I was originally thinking was to use a switch statement or an if-else statement to create each storyline individually. But I'm unsure if that would cause a problem.

EXAMPLE I SPEAK OF:

I create a class with 6 different player characters, then have them selectable via a switch statement (cases 1-6). I am planning to use arrays for the rooms,enemies and equipment. Say I call a piece of array in case 1 of a switch statement, and then that same piece again in case 2. Would that cause a problem? Same deal with if-else. Would calling the same part of the array multiple times over and over again in the same part of the program cause a problem?
swilkewitz
swilkewitz

Now that I have a semi-decent battle system up and running, I want to move on to the next item on my list-multiple characters. The only problem is, each character in my game has their own storyline to follow. So, what I was originally thinking was to use a switch statement or an if-else statement to create each storyline individually. But I'm unsure if that would cause a problem.

EXAMPLE I SPEAK OF:

I create a class with 6 different player characters, then have them selectable via a switch statement (cases 1-6). I am planning to use arrays for the rooms,enemies and equipment. Say I call a piece of array in case 1 of a switch statement, and then that same piece again in case 2. Would that cause a problem? Same deal with if-else. Would calling the same part of the array multiple times over and over again in the same part of the program cause a problem?


There is no limit to how often you can use an array, so there won't be a problem. I would also suggest using a vector array, because they are more dynamic. Using a vector would allow you to change the size of your array while your program is running, so if you wanted to add more characters later you wouldn't have to change the definition of your array.
Captain P
Captain P
There are probably better ways to add support for multiple characters and storylines to your game. Can you give us more information about how you've set up your code so far?
dmatter
dmatter
You'd probably be better off creating a Dialog or Storyline class and associate it with the relevant entity (like making it an attribute of the entity).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.