Double kill.

so my problem now is i have a score system when actor is killed score goes up +1

but what if i kill 2 actors at the same time like after 0.5 seconds gap between how would i make the score system think its a double kill? so you would get more points?

Comments

  • FallacyStudiosFallacyStudios Member Posts: 970
    You just need to keep track of the time of the last kill. Then if they get another kill in under 0.5 seconds from the last kill its a double kill. You essentially spelled it out in your question.
  • AdamgoproAdamgopro Member Posts: 310
    how would i write this in code?
  • FallacyStudiosFallacyStudios Member Posts: 970
    @Adamgopro‌

    You need a real... LastKill

    Then wherever you have it registering a kill add a change attribute that sets LastKill to game.time. Then where you add the point or whatever for the kill add a rule that states something like

    If game.time <= LastKill+0.5 then double points or whatever you plan on doing.

    That is essentially what you need, but it will take some slight tweaking as I don't know how your current code is set up.
  • AdamgoproAdamgopro Member Posts: 310
    @fallacystudios excellent thanks for this ! thank you very much :)
Sign In or Register to comment.