Пример #1
0
        /// <summary>
        /// Загрузка спрайтов игрока и звуков
        /// </summary>
        public void LoadContent()
        {
            picture = GameData.Instance.content.Load<Texture2D>("Images/winnie");
            ImageRenderComponent irc = new ImageRenderComponent("player", this, ref picture);
            addComponent(irc);
            // Установить размер объекта
            Size = new Vector2(picture.Width, picture.Height);  // TODO может быть перенести в конструктор компонента?

            KeyboardInputComponent kic = new KeyboardInputComponent("KeyboardInputComponent", this);
            addComponent(kic);
        }
Пример #2
0
        /// <summary>
        /// Загрузка спрайтов игрока и звуков
        /// </summary>
        public void LoadContent()
        {
            picture = GameData.Instance.content.Load <Texture2D>("Images/winnie");
            ImageRenderComponent irc = new ImageRenderComponent("player", this, ref picture);

            addComponent(irc);
            // Установить размер объекта
            Size = new Vector2(picture.Width, picture.Height);  // TODO может быть перенести в конструктор компонента?

            KeyboardInputComponent kic = new KeyboardInputComponent("KeyboardInputComponent", this);

            addComponent(kic);
        }