Пример #1
0
        public static SpriteRepository getInstance()
        {
            if (Instance == null)
            {
                Instance = new SpriteRepository();
            }

            return(Instance);
        }
Пример #2
0
        public Background() : base("Background", "Background", new Rectangle(), new Point(-100, 0), new Size(8000, 4000))
        {
            SpriteRepository resourses = SpriteRepository.getInstance();
            Shape            shape     = new Rectangle();

            shape.Height = 1080;
            shape.Width  = 8000;
            Collider     = null;
            shape.Fill   = resourses.Sprites["bg.jpg"];
            Shape        = shape;
        }
Пример #3
0
        public Platform(string _id, Point Point, Size anySize) : base(_id, "Platform", new Rectangle(), Point, anySize)
        {
            SpriteRepository resourses = SpriteRepository.getInstance();
            Shape            shape     = new Rectangle();

            shape.Height = anySize.Height;
            shape.Width  = anySize.Width;
            Random rand = new Random(DateTime.Now.Second);

            shape.Fill = resourses.Platforms[rand.Next(0, resourses.Platforms.Count)];
            Shape      = shape;
        }
Пример #4
0
        public Coin(string id, Point point) : base(id, "Coin", new Ellipse(), point, new Size(50, 50))
        {
            Script = new CoinScript();

            SpriteRepository resourses = SpriteRepository.getInstance();
            Shape            shape     = new Rectangle();

            shape.Height = 50;
            shape.Width  = 50;
            Random rand = new Random(DateTime.Now.Second);

            shape.Fill = resourses.Sprites["bronze_2.jpg"];
            Shape      = shape;
        }
Пример #5
0
        public Player(string _id, Point Point, Size anySize, Label score) : base(_id, "Player", new Rectangle(), Point, anySize)
        {
            label = score;
            Score = 0;
            SpriteRepository resourses = SpriteRepository.getInstance();
            Shape            shape     = new Rectangle();

            shape.Height = anySize.Height;
            shape.Width  = anySize.Width;
            Random rnd = new Random(DateTime.Now.Second);

            shape.Fill = resourses.Players[rnd.Next(0, resourses.Players.Count)];
            Shape      = shape;

            Control     = new ControllerScript();
            HealthPoint = 100;
            IsAlive     = true;
        }