Пример #1
0
        /// <summary>
        /// Initiates the game by painting the background
        /// and initiating the hero
        /// </summary>
        public void InitGame()
        {
            ClearBackground();
            actor = new Sprite { X = 10, Y = 38 };

            CreateObstacles();
            DrawObstacles();
        }
Пример #2
0
        private void CreateObstacles()
        {
            int start = 40;

            Sprite o;
            for (var i = 0; i < obstacles.Length; i++)
            {
                o = new Sprite();
                o.X = start;
                o.Y = actor.Y;

                if (obstacles[i] == 0)
                {
                    o.IsActive = false;
                }

                Obstacles.Add(o);
                start++;
            }
        }