make game harder !

0 favourites
  • 15 posts
From the Asset Store
20 high quality click sounds, ready to improve your game's UI instantly
  • hi

    i create a shooter game that have alot of enemies and when you kill them your score going up and up

    i want to make game harder just like this :

    =============================================

    when my score is 100 coefficient add 10 value to my enemy's health

    score = 100 / add 10 to health

    score = 200 / add 10 to health

    .

    .

    .

    =============================================

    how can i make this Algorithm for my game ?

    Attention : i can't upload Capx file its security    <img src="smileys/smiley4.gif" border="0" align="middle" />

  • system compare two values - if score > 100 - enemy set health to enemy.health+10?

  • Set Enemy Health to EnemyBaseHealth + score / 10

  • system compare two values - if score > 100 - enemy set health to enemy.health+10?

    this events just one time add 10 value to health (when the score is grater than 100)

    how about the score is grater than 200 or 300?

  • i make a capx file and when the score is grater than 150/300/450/... enemy's speed going to be 100/150/200/... but these events work for just 2 or 3 seconds and the speed goes back to default ! (100) WHY?

    anyone can help me?

    dropbox.com/s/wzby2tfuxtc43il/Sample2.capx

  • improved

    I added a global variable for speed.

  • r142 ! i have r139 stable free edition

    can you take a photo from your event sheet?

  • do this:

    score%100 = 0 / add 10 to health

    the % symbol after Score its the mod function, wich gives you the remaining of a division. So 100/100=1 no remaining so it will add 10 to health. 200/100=2 no remaining, the same happens.

  • you need to keep checking the score, then check to see if you already increased the health for that range. I'd make 2 variables. "PlayerLevel" that tells you which range you are in: (score / 100) then you need to round down. i.e. 950 / 100 is 9.5 then round down to 9 and you are at level 9. The other variable is the current enemy's level "EnemyLevel". Compare this to the player's level and if they aren't equal, then you know your score went to the next range. Remember levels are base zero.

    initialize PlayerLevel set to 0

    initialize EnemyLevel set to 0

    game loop

    //get the player's current level from the score

    set value PlayerLevel to Round down (Score / 100)

    //check to see if it's beyond the last time you increased the enemy's health

    if PlayerLevel > EnemyLevel

        add 10 to Enemy.health

        add 1 to EnemyLevel

    this assumes you can't lose points off your score...

  • Thanks you All

    ((you need to keep checking the score, then check to see if you already increased the health for that range. I'd make 2 variables. "PlayerLevel" that tells you which range you are in: (score / 100) then you need to round down. i.e. 950 / 100 is 9.5 then round down to 9 and you are at level 9. The other variable is the current enemy's level "EnemyLevel". Compare this to the player's level and if they aren't equal, then you know your score went to the next range. Remember levels are base zero.

    initialize PlayerLevel set to 0

    initialize EnemyLevel set to 0

    game loop

    //get the player's current level from the score

    set value PlayerLevel to Round down (Score / 100)

    //check to see if it's beyond the last time you increased the enemy's health

    if PlayerLevel > EnemyLevel

        add 10 to Enemy.health

        add 1 to EnemyLevel

    this assumes you can't lose points off your score...))

    still i have that problem :(

    watch this :

    dropbox.com/s/odssg63xkozu8oc/sample%20bullet.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • plz help me ....

  • I haven't looked at your capx yet.. not home.. but did you make your variables global?

    Make a text field on the screen and populate it with EnemyLevel and PlayerLevel variables.. it will show you what's happening to those variables.. if they are getting reset somehow..

    the top of your screen should look like this:

    Score: 350 PlayerLevel:3 EnemyLevel:3 EnemyHealth: 35 (or whatever)

    then

    Score: 425 PlayerLevel:4 EnemyLevel:4 etc..........

    if the Level variables are not the correct values, I think you'll probably figure it out from there...

    I'll check it out the capx later...

  • you were only referencing some of the enemies.. and not the original instance from your layout.

    I added another variable.. "NewSpeed".. which I set the enemy to everytime one was created. I don't know if there's a way to change the initial state..

    and I let the old enemies keep their speed... just all new enemies had the new speed... if you want all enemy to be set instantly to the NewSpeed then enable that line I had in there after the check of PL>EL

    also you were dividing by 150? it should be 100...

  • THX alot i solve it <img src="smileys/smiley4.gif" border="0" align="middle" />

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