Beispiel #1
0
    public override void execute(VGDLSprite sprite1, VGDLSprite sprite2, VGDLGame game)
    {
        if (sprite1 == null)
        {
            throw new ArgumentException("1st sprite can't be EOS with spawn interaction.");
        }

        if (!sprite1.is_disabled())
        {
            VGDLSprite newSprite = game.addSprite(stype, sprite1.getPosition());
            doTransformTo(newSprite, sprite1, sprite2, game);
        }
    }
Beispiel #2
0
    public override void execute(VGDLSprite sprite1, VGDLSprite sprite2, VGDLGame game)
    {
        if (sprite1 == null)
        {
            throw new ArgumentException("1st sprite can't be EOS with spawn interaction.");
        }

        if (UnityEngine.Random.value >= prob)
        {
            return;
        }
        game.addSprite(stype, sprite1.getPosition());
    }
Beispiel #3
0
    private void addEvent(VGDLSprite s1, VGDLSprite s2)
    {
        if (s1.is_avatar || s1.is_from_avatar)
        {
            historicEvents.Add(
                new RecordedEvent(gameTick, s1.is_from_avatar,
                                  s1.getType(), s2.getType(),
                                  s1.spriteID, s2.spriteID, s1.getPosition()));
        }

        else if (s2.is_avatar || s2.is_from_avatar)
        {
            historicEvents.Add(
                new RecordedEvent(gameTick, s2.is_from_avatar,
                                  s2.getType(), s1.getType(),
                                  s2.spriteID, s1.spriteID, s2.getPosition()));
        }
    }
Beispiel #4
0
    public override void execute(VGDLSprite sprite1, VGDLSprite sprite2, VGDLGame game)
    {
        if (sprite1 == null)
        {
            throw new ArgumentException("1st sprite can't be EOS with SpawnIfHasLess interaction.");
        }

        applyScore = false;

        if (Random.value >= prob)
        {
            return;
        }

        if (sprite1.getAmountResource(resource) <= limit)
        {
            game.addSprite(stype, sprite1.getPosition());
            applyScore = true;
        }
    }
    public override void execute(VGDLSprite sprite1, VGDLSprite sprite2, VGDLGame game)
    {
        if (sprite1 == null)
        {
            throw new ArgumentException("1st sprite can't be EOS with TransformToRandomChild interaction.");
        }

        var subtypes = game.getSubTypes(stype);

        var rndtype = subtypes.RandomElement();

        try
        {
            var newSprite = game.addSprite(rndtype, sprite1.getPosition());
            doTransformTo(newSprite, sprite1, sprite2, game);
        }
        catch (Exception)
        {
            throw new ArgumentException("Can't construct a parent node to the child " + stype + " sprite in TransformToRandomChild interaction.");
        }
    }