Пример #1
0
    public Placeholder(FixedPoint _scale)
    {
        scale = _scale;
        type  = EntityType.Placeholder;
        body  = new OrientedBoxBody(position, scale, scale, 0, this);

        body.SetLayer(type);
        body.SetCollidesWith(EntityType.Ufo, true);
        body.SetCollidesWith(EntityType.Asteroid, true);

        behavior = new PlaceholderBehavior(this);
    }
Пример #2
0
    public Blast(FixedPointVector3 pos, FixedPointVector3 dir, Entity _source)
    {
        position  = pos;
        direction = dir;
        speed     = Extensions.Range(2, 3);
        angle     = (FixedPoint)(Mathf.Atan2(-dir.X.Float, dir.Y.Float));

        type  = EntityType.Blast;
        body  = new OrientedBoxBody(pos, (FixedPoint)0.13f, (FixedPoint)0.39f, -angle, this);
        scale = (FixedPoint)0.25f;

        body.SetLayer(type);
        body.SetCollidesWith(EntityType.Ufo, true);
        body.SetCollidesWith(EntityType.Asteroid, true);

        behavior = new BlastBehavior(this);

        source = _source;
    }