Esempio n. 1
0
 public Door(Texture2D texture, Vector2 position, SpriteBatch spriteBatch, DungeonPlanetGame ctx)
     : base(texture, position, spriteBatch)
 {
     _lib         = new EnemyLib(new System.Numerics.Vector2(position.X, position.Y), texture.Width, texture.Height, 100);
     _spritebatch = spriteBatch;
     _ctx         = ctx;
 }
Esempio n. 2
0
 public Weapon(Texture2D weaponTexture, Texture2D bulletTexture, DungeonPlanetGame ctx, Vector2 position, SpriteBatch spritebatch, EnemyLib enemyLib)
     : base(weaponTexture, position, spritebatch)
 {
     _enemyLib      = enemyLib;
     _origin        = new Vector2(-2, 7);
     WeaponLib      = new WeaponLib();
     Bullets        = new List <Bullet>();
     BulletsEnemy   = new List <Bullet>();
     _time          = 0;
     _ctx           = ctx;
     _bulletTexture = bulletTexture;
 }
Esempio n. 3
0
 public Enemy(Texture2D texture, Vector2 position, SpriteBatch spritebatch, string type, Texture2D fireTexture, int frameWidth, int frameHeight, int numberLin, int frameCount, int frameTime, DungeonPlanetGame ctx)
     : base(texture, position, spritebatch)
 {
     EnemyLib     = new EnemyLib(new System.Numerics.Vector2(position.X, position.Y), 40, 55, 30);
     _player      = Player.CurrentPlayer;
     PlayerLib    = Player.CurrentPlayer.PlayerLib;
     _count       = 0;
     _ctx         = ctx;
     _type        = type;
     _spritebatch = spritebatch;
     Fire         = new Sprite(fireTexture, new Vector2(EnemyLib.Position.X, EnemyLib.Position.Y), _spritebatch);
     _animation   = new Animation();
     _animation.Initialize(texture, position, frameWidth, frameHeight, 0, numberLin, frameCount, frameTime, Color.White, 1, true, true);
 }
Esempio n. 4
0
        public Menu(DungeonPlanetGame ctx)
        {
            _ctx   = ctx;
            _panel = new Panel(new Vector2(1300, 750));
            UserInterface.Active.AddEntity(_panel);
            _panel.AddChild(new Header("Dungeon Planet"));
            _panel.AddChild(new LineSpace());
            _panel.AddChild(new HorizontalLine());
            _panel.AddChild(new LineSpace());
            _continue = new Button("Reprendre", ButtonSkin.Default, Anchor.AutoCenter, new Vector2(1000, 120));
            _panel.AddChild(_continue);
            _newGame = new Button("Nouvelle Partie", ButtonSkin.Default, Anchor.AutoCenter, new Vector2(1000, 120));
            _panel.AddChild(_newGame);
            _loadGame = new Button("Charger Partie", ButtonSkin.Default, Anchor.AutoCenter, new Vector2(1000, 120));
            _panel.AddChild(_loadGame);
            _options = new Button("Option", ButtonSkin.Default, Anchor.AutoCenter, new Vector2(1000, 120));
            _panel.AddChild(_options);
            _quit = new Button("Quitter", ButtonSkin.Default, Anchor.AutoCenter, new Vector2(1000, 120));
            _panel.AddChild(_quit);

            _pOption = new Panel(new Vector2(1300, 750));
            UserInterface.Active.AddEntity(_pOption);
            _pOption.AddChild(new Header("Options"));
            _fullscreen = new CheckBox("Pleine Ecran");
            _pOption.AddChild(new LineSpace());
            _pOption.AddChild(new HorizontalLine());
            _pOption.AddChild(new LineSpace());
            _pOption.AddChild(_fullscreen);
            _fullscreen.Checked = _ctx.Graphics.IsFullScreen;
            _pOption.AddChild(new LineSpace());
            _pOption.AddChild(new HorizontalLine());
            _pOption.AddChild(new LineSpace());
            _pOption.AddChild(new Paragraph("Volume de la musique"));
            _music = new Slider(0, 100);
            _pOption.AddChild(_music);
            _music.Value = (int)(MediaPlayer.Volume * 100);
            _pOption.AddChild(new HorizontalLine());
            _pOption.AddChild(new Paragraph("Volume des effets sonores"));
            _effect = new Slider(0, 100);
            _pOption.AddChild(_effect);
            _effect.Value = (int)(SoundEffect.MasterVolume * 100);
            _pOption.AddChild(new LineSpace());
            _pOption.AddChild(new HorizontalLine());
            _pOption.AddChild(new LineSpace());
            _return = new Button("Retour");
            _pOption.AddChild(_return);
            _pOption.Visible = false;
        }
Esempio n. 5
0
 public Board(SpriteBatch spritebatch, Texture2D tileTexture, int columns, int rows, DungeonPlanetGame ctx)
 {
     TileTexture    = tileTexture;
     SpriteBatch    = spritebatch;
     Level          = new Level();
     _tilesLookList = new List <TilesLook>();
     CreateNewBoard();
     CurrentBoard = this;
     _ctx         = ctx;
     if (ctx._camera != null)
     {
         _rectange = new Rectangle((int)ctx._camera.GetBounds().X,
                                   (int)ctx._camera.GetBounds().Y + 325,
                                   (int)(ctx._camera.GetBounds().Width),
                                   (int)(ctx._camera.GetBounds().Height));
     }
 }
Esempio n. 6
0
 public Player(Texture2D texturePlayer, Texture2D textureWeapon, Texture2D textureBomb, Texture2D sfx, Texture2D textureBullet, DungeonPlanetGame ctx, Vector2 position, SpriteBatch spritebatch, List <Enemy> enemys, List <Boss> bosses)
     : base(texturePlayer, position, spritebatch)
 {
     PlayerLib  = new PlayerLib(new System.Numerics.Vector2(position.X, position.Y), 40, 64);
     PlayerInfo = new PlayerInfo();
     _animation = new Animation();
     _animation.Initialize(texturePlayer, position, 40, 64, 0, 0, 2, 150, Color.White, 1, true, false);
     _sfx          = sfx;
     Weapon        = new Weapon(textureWeapon, textureBullet, ctx, position, spritebatch, bosses);
     _bombs        = new List <Bomb>();
     _texturebomb  = textureBomb;
     _spritebatch  = spritebatch;
     _enemys       = enemys;
     CurrentPlayer = this;
 }
Esempio n. 7
0
 static void Main()
 {
     using (var game = new DungeonPlanetGame())
         game.Run();
 }
Esempio n. 8
0
 public Door(Texture2D texture, Vector2 position, SpriteBatch spriteBatch, DungeonPlanetGame ctx, Level.LevelID ID)
     : this(texture, position, spriteBatch, ctx)
 {
     _id = ID;
 }