Example #1
0
 public MenuState()
 {
     _ellapsed = 0;
     _counter  = 0;
     _bg       = GraphicsConvert.ToTexture2D(Properties.Resources.menu_bg);
     _moved    = GraphicsConvert.ToTexture2D(Properties.Resources.menu_moved2);
     _newGame  = GraphicsConvert.ToTexture2D(Properties.Resources.menu_new_game);
     _exit     = GraphicsConvert.ToTexture2D(Properties.Resources.menu_exit);
     for (int i = 0; i < 28; i++)
     {
         for (int j = 0; j < 18; j++)
         {
             _field[i, j] = new Vector2(i * 30 - 30, j * 30 - 30);
         }
     }
 }
Example #2
0
 //Конструктор класса
 public Player(Vector2 position) :  base(position)
 {
     _ellapsedTime = 0;
     //Загрузка анимации простоя
     _standTexture = GraphicsConvert.ToTexture2D(Resources.cstand);
     _standSprite  = new AnimatedSprite(_standTexture, 1, new long[] { 200 });
     //Загрузка анимации движения
     _walkTexture = GraphicsConvert.ToTexture2D(Resources.cwalk);
     _walkSprite  = new AnimatedSprite(_walkTexture, 3, new long[] { 100 });
     //Загрузка анимации прижка
     _jumpTexture = GraphicsConvert.ToTexture2D(Resources.cjump);
     _jumpSprite  = new AnimatedSprite(_jumpTexture, 4, new long[] { 50 });
     //Загрузка анимации атаки
     _attackTexture = GraphicsConvert.ToTexture2D(Resources.cstand);
     _attackSprite  = new AnimatedSprite(_attackTexture, 1, new long[] { 200 });
     //Инициализация класса
     Initialize(_standSprite, _walkSprite, _jumpSprite, _attackSprite);
 }