Multiply Scores from destroyed instances

0 favourites
  • 7 posts
  • Hello!, i'm looking a simple solution

    If a instance is destroyed, added 100 to variable

    If 2 instances are destroyed, multiply the scores to variable like 400


    1 destroyed instance = 100

    2 destroyed instances = 400

    3 destroyed instances = 900

    Do you have an idea how to implement?


  • Global variable InstancesDestroyed (or scoreMultiplier, which ever is the fitting)

    ->On object destroyed: increment variable

  • vee41 but that's basic, i already implemented that, i'm looking a solution when you destroy an instance, you get 100 points, it's basic, but if you destroy 2 instances in same time, you get bonus points like 400 points.

    Do you know what i mean?

  • Oh, so it would be like multikill or killstreak? Set a timer that resets the multiplier if you don't make a kill in certain time.

  • vee41

    Im creating scores for puzzle game, i don't think it needs a timer, it could affect destroyed blocks in chain way.

  • I edited my old example a bit, here is an example how you could do it:

    Matcher demo

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Global variable:

    var score = 0;      // Player's score.

    var multiply = 1.0; // Multiply rate for score.

    var destCount = 0; // How many objects were destroyed just now?

    Instance variable for the object:

    var score = 100;    // Default score if only destroyed 1 in a row.

    Every tick:

    multiply = destCount^2

    For each object:

    ----If (Object was destroyed)

    -------{+1 to destCount; +(object.score*multiply) to global score; destCount = 0;}

    Haven't try yet but hope this would help~ ^_^

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