variable adjustment

Discussion and feedback on Construct 2

Post » Thu Jul 27, 2017 7:20 am

At the end of the level (20 minions dead) I put a boos a lot harder to kill, if you do so, you get your points and all that, but the tricky part is that killing the boss must update an instance variable called life, in order to make the minions a little more dificult.
B
1
Posts: 1
Reputation: 127

Post » Thu Jul 27, 2017 8:52 am

I usually use a global variable to scale enemy difficulty, along with a "boss" group (activated when it is time for the boss to appear)
for example I could have a variable called minionhealthscale set to 1.
when creating minions, do this:
condition
Code: Select all
loop: 20 times;
action
Code: Select all
create: minion at (x,y)
action
Code: Select all
set minion.life: =10*minionhealthscale
- this makes the minion health correctly when each minion is created

then to activate your boss group:
condition
Code: Select all
minions destroyed: =20
action
Code: Select all
set group "boss" enabled


Then your boss group would have these codes in it:
Code: Select all
BOSS GROUP

Code: Select all
various boss creation and attack codes etc


when the boss is defeated:
conditions
Code: Select all
bosshealth < 1;trigger once while true;
action
Code: Select all
boss: destroy

action
Code: Select all
set minionhealthscale: =minionhealthscale*10

action
Code: Select all
disable group "boss"


obviously the way you scale minionhealthscale will affect how much more health the minions have each time the boss group activates. Above I have it so that the minion health multiplies by 10 after each boss, so your minions might have 10 health, then 100 health, then 1000 and so on. You could use +10 which would just make it 1 11 21 31 41 etc, or any equation you want to balance your game.

I hope this helped * edit made it clearer and more relevant to your needs
B
4
Posts: 8
Reputation: 277


Return to Construct 2 General

Who is online

Users browsing this forum: newt, rbailey83, Yahoo [Bot] and 24 guests