Ejemplo n.º 1
0
 public override void execute(VGDLSprite sprite1, VGDLSprite sprite2, VGDLGame game)
 {
     effectDelegate.execute(sprite1, sprite2, game);
     if (repeating)
     {
         planExecution(game);
     }
 }
Ejemplo n.º 2
0
    public void executeEffect(VGDLEffect ef, VGDLSprite s1, VGDLSprite s2)
    {
        // There is a collision. Apply the effect.
        ef.execute(s1, s2, this);

        // Affect score:
        if (ef.applyScore)
        {
            // apply scores for all avatars
            for (int i = 0; i < no_players; i++)
            {
                avatars[i].addScore(ef.getScoreChange(i));
            }
        }

        // Add to events history.
        if (s1 != null && s2 != null)
        {
            addEvent(s1, s2);
        }

        if (ef.count)
        {
            for (int i = 0; i < no_counters; i++)
            {
                counters[i] += ef.getCounter(i);
            }
        }

        if (ef.countElse)
        {
            for (int i = 0; i < no_counters; i++)
            {
                counters[i] += ef.getCounterElse(i);
            }
        }
    }