Death counter

Hey Guys,

I am working on a game right now and every level will have a certain number of enemies you need to kill inorder to move to the next level. What would be the most efficient way to do this...every level will have a different number of enemies that spawn during that level.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Make a game attribute.

    Call it something like 'Kills'.

    Level 1 - change 'Kills' to 10 - a kill will reduce this number by 1.

    Level 2 - change 'Kills' to 20 - a kill will reduce this number by 1.

    Level 3 - change 'Kills' to 30 - a kill will reduce this number by 1.

    . . . etc

  • quinn221quinn221 Member Posts: 280

    thanks

    @Socks said:
    Make a game attribute.

    Call it something like 'Kills'.

    Level 1 - change 'Kills' to 10 - a kill will reduce this number by 1.

    Level 2 - change 'Kills' to 20 - a kill will reduce this number by 1.

    Level 3 - change 'Kills' to 30 - a kill will reduce this number by 1.

    . . . etc

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2017

    @quinn221 said:
    thanks

    If you have dozens or even hundreds of levels - and don't want to enter a new value for each scene you could do this . . . .

    Game attribute: 'Kills'.
    Game attribute: 'Default Kills'.

    On each scene cut/paste these two change attribute behaviours:

    Change 'Default Kills' to 'Default Kills' +10
    Change 'Kills' to 'Default Kills'.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    You could also have each enemy that is spawned increase the kills counter when that enemy is spawned by putting a Change Attribute behavior in the enemy that says:

    change kills to kills +1

    so each time an enemy is spawned the counter will increase by 1. This will set the value automatically for each level based on the number of enemies on that level.

Sign In or Register to comment.