How would I add a "difficulty" feature?

Get help using Construct 2

Post » Sun Mar 25, 2012 9:13 pm

My game is near completion. All I need to do now is add in an easy, normal, and hard mode! I tried doing this and failed :/. My idea to doing this was making a global variable, "difficulty". You can pick either easy(which would set the global variable to 1), normal ( which sets it to 2), or hard (which sets it to 3). I then went to my events sheet and added in a new event that made it so if the difficulty variable was 1, it would set the enemies health to 2. If the difficulty was 2, it would set the enemies health to 5. If the difficulty was 3, it set its health to 10. Now my enemies wont die when I play my game!!! What do I need to change??mitchjohnson522012-03-25 21:14:18
B
7
S
1
Posts: 97
Reputation: 1,167

Post » Sun Mar 25, 2012 9:15 pm

u can have the variable be multiplied by the difficulty level.

The way you are doing it seems a good way aswell, do you track your variables? What's their value after u done this ?
B
22
S
11
G
9
Posts: 133
Reputation: 6,572

Post » Sun Mar 25, 2012 9:22 pm

I dont track them ingame, I have no idea how to haha. It seems to me that it just keeps setting their health back up to what its supposed to start at... How would I make it so it only does this once?
B
7
S
1
Posts: 97
Reputation: 1,167

Post » Sun Mar 25, 2012 9:28 pm

An enemy have variable life = 50 in normal dificulty

at hard dificulty you can multiply or add more life to the enemy
the same for anything that make it harder, if it's a RPG then damage will be higher, etc.

example:
if global variable difficulty = 3 (harder)
then set enemy life = 10 * global variable difficulty
then the enemy will have 30LIFE.
if it's on easy difficulty
it will be 10 * 1 = 10.

You can also make the layout harder.. example: you have a plataformer game.
in normal difficulty there's 2 platforms to jump.. at harder dificulty there's only 1.Guif0DA2012-03-25 22:06:57
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sun Mar 25, 2012 9:30 pm

ok so how would I add the extra health to the hard mode enemy?
B
7
S
1
Posts: 97
Reputation: 1,167

Post » Sun Mar 25, 2012 9:31 pm

[QUOTE=mitchjohnson52] ok so how would I add the extra health to the hard mode enemy?[/QUOTE]
I edited my post with a simple example ;)
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sun Mar 25, 2012 9:34 pm

Thanks :). So I would actually type "10 * Difficulty" and it would set it to that?
B
7
S
1
Posts: 97
Reputation: 1,167

Post » Sun Mar 25, 2012 10:06 pm

[QUOTE=mitchjohnson52] Thanks :). So I would actually type "10 * Difficulty" and it would set it to that?[/QUOTE]

yea.

Just make sure that when player select Hard mode, set global variable dificulty to 3 or whatever number u prefer, but must be bigger then normal and easy.

easy could also be 0,5.
then if an enemy have 20 life, on easy mode it will have 10 life.
20*0.5 = 10
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sun Mar 25, 2012 10:41 pm

This still runs into the problems I was having before. How do I make it so this event only occurs one time? So when you select your difficulty, it changes the health of the enemy ONCE. Any suggestions?
B
7
S
1
Posts: 97
Reputation: 1,167

Post » Sun Mar 25, 2012 10:44 pm

I just tried making it so it happens on the start of the layout, but that seems to only change the health of the already spawned enemies. The new enemies that are spawned still have the base 5 health :/
B
7
S
1
Posts: 97
Reputation: 1,167

Next

Return to How do I....?

Who is online

Users browsing this forum: GSquadron, jeffige, MarkThomas, MisterAqua, Nifl, paala and 21 guests