Пример #1
0
        public static SingularityMine CreatePowerlessMine(SceneMgr mgr, Vector pos, Vector dir, Player plr)
        {
            SingularityMine mine = new SingularityMine(mgr, IdMgr.GetNewId(mgr.GetCurrentPlayer().GetId()));

            mine.Position  = pos;
            mine.Owner     = plr;
            mine.Radius    = 2;
            mine.Direction = dir;
            mine.Color     = Colors.BlueViolet;
            mine.SetGeometry(SceneGeometryFactory.CreateMineImage(mine));

            SphereCollisionShape cs = new SphereCollisionShape();

            cs.Center           = mine.Center;
            cs.Radius           = mine.Radius;
            mine.CollisionShape = cs;

            PowerlessSingularityControl sc = new PowerlessSingularityControl();

            sc.Speed         = plr.Data.MineGrowthSpeed;
            sc.Strength      = plr.Data.MineStrength;
            sc.StatsReported = true;
            mine.AddControl(sc);

            mine.AddControl(new StickySphereCollisionShapeControl());
            return(mine);
        }
Пример #2
0
        public static SingularityMine CreateDroppingSingularityMine(SceneMgr mgr, Point point, Player plr)
        {
            SingularityMine mine = new SingularityMine(mgr, IdMgr.GetNewId(mgr.GetCurrentPlayer().GetId()));

            mine.Position  = new Vector(point.X, 0);
            mine.Owner     = plr;
            mine.Radius    = 12;
            mine.Direction = new Vector(0, 1);
            mine.Color     = Colors.BlueViolet;

            SphereCollisionShape cs = new SphereCollisionShape();

            cs.Center           = mine.Center;
            cs.Radius           = mine.Radius;
            mine.CollisionShape = cs;

            DroppingSingularityControl sc = new DroppingSingularityControl();

            sc.Speed    = plr.Data.MineGrowthSpeed;
            sc.Strength = plr.Data.MineStrength;
            mine.AddControl(sc);

            LinearMovementControl lmc = new LinearMovementControl();

            lmc.Speed = plr.Data.MineFallingSpeed;
            mine.AddControl(lmc);

            LinearRotationControl lrc = new LinearRotationControl();

            lrc.RotationSpeed = (float)FastMath.LinearInterpolate(0, Math.PI, mgr.GetRandomGenerator().NextDouble());
            mine.AddControl(lrc);

            mine.AddControl(new StickySphereCollisionShapeControl());

            mine.SetGeometry(SceneGeometryFactory.CreateMineImage(mine));

            return(mine);
        }