Hi guys, just a theory question here, not asking for anyone to specifically write me a script.
I’m working on a brick breaker game (the one with a ball and paddle) and currently have about 5 levels set up. I want the difficulty to be centered around how fast the game is however I’m using a game manager script that sets the timescale to 1 upon startup and i can’t figure out a way to increase the speed without it causing every level to get the same.
Any help is appreciated!
you could collect all the items whose speed you wish to increase at load into a list and iterate through the list to increase there speed.
Alternatly and perhaps easier is to declare a static variable TimeStep = 1;
go through your scripts and Control + F to search for instances of time.deltatime and tack on after them
(time.deltatime * TimeStep);
now by making TimeStep < 1 you’ll do everything slower, and making it > 1 faster.
you can then on loading the level change TimeStep;
alternaltly you can have a static list with a list of modifiers for each level so
int Cur_level;
float GlobalDifficultyMod;
list LevelDifficultyMod;
the global would actually be part of the difficulty at the start screen, you can basically use global to modify every levels difficulty for a kind of easy, normal, hard difficulty of the game select.
Then a list which has numerous difficulties and just in script updates;
time.deltatime * LevelDifficultyMod[Cur_Level] * GlobalDifficultyMod;