Example #1
0
        public Debris Create(LineSegment l, Point2D pos, Rectangle playArea)
        {
            Shape shape = new Shape(new List <LineSegment> {
                l
            }, null, SwinGame.PointAt(0, 0));
            List <Color> colors = new List <Color> {
                Color.Red
            };

            BoundaryStrategy boundaryStrat = new DieBoundaryBehaviour(playArea);
            Debris           result        = new Debris("debris", null, pos, SwinGame.PointAt(0, 0), shape, colors, boundaryStrat,
                                                        1, Util.RandomUnitVector().Multiply(2), Util.RandomUnitVector(), 0.97f, Util.Rand(10), 0.7f, Team.Computer);

            result.TeleportTo(pos);

            return(result);
        }
Example #2
0
        public NumberPopup Create(Point2D pos, int points)
        {
            Point2D offset = SwinGame.PointAt(Util.Rand(30) - 15, Util.Rand(30) - 15);

            pos = pos.Add(offset);

            List <Color> colors = new List <Color>()
            {
                Color.Yellow
            };
            float vel = Util.Rand(1000, 3000) / 1000f;

            float            x             = Util.Rand(500, 2000) / 8000f;
            Vector           dir           = SwinGame.VectorTo(x, -1);
            float            lifetime      = 1;
            BoundaryStrategy boundaryStrat = new DieBoundaryBehaviour(playArea);

            return(new NumberPopup(points.ToString(), points, pos, colors, vel, dir, lifetime, boundaryStrat, Team.None, true));
        }