Example #1
0
 public void _on_Area2D_body_entered(Node body)
 {
     if (!(body is Juni juni))
     {
         return;
     }
     juni.setPower(power, true);
     GDArea.playEffect(Coords);
     juni.playSound("powerup");
     QueueFree();
 }
Example #2
0
    protected override void _execute(Juni juni)
    {
        if (sound != null)
        {
            juni.playSound(sound);
        }

        if (!trigger.ObjectID.Equals(new KnyttPoint(0, 0)))
        {
            var spawn_points = GDArea.Objects.findObjects(new KnyttPoint(0, ObjectID.y + 10));
            if (spawn_points.Count > 0)
            {
                foreach (var spawn_point in spawn_points)
                {
                    addObject(spawn_point.Coords);
                }
            }
            else
            {
                addObject(trigger.AbsolutePosition);

                if (trigger.Effect)
                {
                    var offset = new Vector2(trigger.EffectOffset.x, trigger.EffectOffset.y);
                    GDArea.playEffect(trigger.AbsolutePosition, offset);
                }
            }
        }

        var delete_points = GDArea.Objects.findObjects(new KnyttPoint(0, ObjectID.y + 13));

        foreach (var delete_point in delete_points)
        {
            (delete_point as DeletePoint).activate();
        }
    }