- Home /
Which would be the better way to make a game with different levels and different NPCs in each level?
Hi all! I'm a total noob and I suck at coding, so I have a general doubt regarding the main structure of my game.
In my 2D game, I have the first level where you only have a main character and 3 other NPCs in 3 slots. In the second level, I want to change the combination of NPCs by adding some new ones and mixing with the ones of the 1st level. In some levels you got 3 NPCs, in others you got 4.
The mechanics of the game is always the same. But in advance levels, the NPCs may offer different behaviours to the Main character.
So the thing is that I have already done the first level, but I don't know how to add scripts for the new NPCs. If I created more level scenes, should I keep just one main script to spawn different enemies or should I create one script for each level? Or is it a better idea to have only 1 scene and initialize different NPCs prefabs?
Each NPCs have different information about positioning, so right now I have that in the main script, but if I want to create several new NPCs, I will have to stored all that data in the main script. Is there any better way? May I included that information as a public variable inside each NPC and then access when I need to initialize a new NPC? or that would be a slow option?
I'm a noob and I don't speak english too well, so sorry If the questions are not understandable.
Your answer
Follow this Question
Related Questions
New scene for minigame or not? 1 Answer
Display Audio Analysis and levels with objects 0 Answers
when i click the GUI button it doesnt load the level 1 Answer
Unity Serializer Wont Load Saves 1 Answer
Online levels database 0 Answers