make game harder !

Get help using Construct 2

Post » Thu Aug 22, 2013 4:34 pm

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    
B
10
S
3
G
2
Posts: 46
Reputation: 2,025

Post » Thu Aug 22, 2013 4:41 pm

system compare two values - if score > 100 - enemy set health to enemy.health+10?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Aug 22, 2013 5:02 pm

Set Enemy Health to EnemyBaseHealth + score / 10
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Thu Aug 22, 2013 6:29 pm

[QUOTE=LittleStain] system compare two values - if score > 100 - enemy set health to enemy.health+10?[/QUOTE]

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?

B
10
S
3
G
2
Posts: 46
Reputation: 2,025

Post » Thu Aug 22, 2013 7:03 pm

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?

https://www.dropbox.com/s/wzby2tfuxtc43il/Sample2.capx
B
10
S
3
G
2
Posts: 46
Reputation: 2,025

Post » Thu Aug 22, 2013 7:17 pm

improved

I added a global variable for speed.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Aug 22, 2013 7:29 pm

r142 ! i have r139 stable free edition

can you take a photo from your event sheet?
viperwar2013-08-22 19:36:51
B
10
S
3
G
2
Posts: 46
Reputation: 2,025

Post » Fri Aug 23, 2013 2:00 am

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.
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Fri Aug 23, 2013 5:14 am

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...
B
97
S
32
G
15
Posts: 1,198
Reputation: 16,178

Post » Fri Aug 23, 2013 9:07 am

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 :

https://www.dropbox.com/s/odssg63xkozu8oc/sample%20bullet.capx
B
10
S
3
G
2
Posts: 46
Reputation: 2,025

Next

Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 15 guests