How would I add a "difficulty" feature?

0 favourites
  • 13 posts
From the Asset Store
Customize the animation of character when item changed
  • 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??

  • 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 ?

  • 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?

  • 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.

  • ok so how would I add the extra health to the hard mode enemy?

  • ok so how would I add the extra health to the hard mode enemy?

    I edited my post with a simple example ;)

  • Thanks :). So I would actually type "10 * Difficulty" and it would set it to that?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks :). So I would actually type "10 * Difficulty" and it would set it to that?

    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

  • 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?

  • 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 :/

  • 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 :/

    when a new enemy spawns set his life variable to X*dificulty

  • Ok I figured it out! the simple way I was trying to do it wasnt gonna work so I did it another way and it worked. Thanks for the help :). One more question, how do I set which layout the game starts on when its loaded?

  • check the project properties > first layout

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)