示例#1
0
文件: Machine.cs 项目: Bajena/Miner
 public Machine(MinerGame game)
     : base(game)
 {
     SetupAnimations();
     State = EMachineState.Normal;
     _pointsForKill = 0;
 }
示例#2
0
文件: Dynamite.cs 项目: Bajena/Miner
 public Dynamite(MinerGame game, TimeSpan timeToExplosion)
     : base(game)
 {
     Type = "Dynamite";
     _timeToExplosion = timeToExplosion;
     Initialize();
 }
示例#3
0
文件: Dynamite.cs 项目: Bajena/Miner
 public Dynamite(MinerGame game)
     : base(game)
 {
     Type = "Dynamite";
     _timeToExplosion = TimeSpan.FromSeconds(1);
     Initialize();
 }
示例#4
0
文件: Explosive.cs 项目: Bajena/Miner
 protected Explosive(MinerGame game)
     : base(game)
 {
     _explodeSound = game.Content.Load<SoundEffect>("Sounds/explode");
     State = EExplosiveState.Idle;
     SetupAnimations();
 }
示例#5
0
文件: GasBottle.cs 项目: Bajena/Miner
        public GasBottle(MinerGame game)
            : base(game)
        {
            Type = "GasBottle";

            var randTime = new Random().Next(500, 1500);
            var explosionWaitTimer = new TimerComponent(this,TimeSpan.FromMilliseconds(randTime), false);
            explosionWaitTimer.Tick += WaitForExplosionFinished;
            Components.Add("ExplosionWaitTimer", explosionWaitTimer);
        }
示例#6
0
        public GameObject(MinerGame game)
        {
            Game = game;
            Type = "GameObject";
            Properties = new PropertyContainer();

            Components = new Dictionary<String, GameObjectComponent>();
            DrawableComponents = new Dictionary<String, DrawableGameObjectComponent>();
            DrawableComponents.Add("Animation", new AnimationComponent(this));
        }
示例#7
0
文件: Cart.cs 项目: Bajena/Miner
        public Cart(MinerGame game)
            : base(game)
        {
            Type = "Cart";

            Components.Add("Physics", new PhysicsComponent(this)
            {
                HasGravity = true
            });
            Components.Add("WorldCollision", new CartWorldCollisionComponent(game,this));

            Velocity = new Vector2(100f, 0);

            IsDestructable = true;
            _pointsForKill = 500;
        }
示例#8
0
文件: Player.cs 项目: Bajena/Miner
        public Player(MinerGame game)
            : base(game)
        {
            Type = "Player";

            Oxygen = SettingsManager.Instance.MaxOxygen;
            Lives = SettingsManager.Instance.StartLives;
            Points = 0;
            Dynamite = SettingsManager.Instance.StartDynamite;

            var oxygenTimer = new TimerComponent(this, TimeSpan.FromSeconds(0.5), true);
            oxygenTimer.Tick += DecreaseOxygen;
            Components.Add("OxygenTimer", oxygenTimer);
            OxygenTimer.Start();
            Components.Add("Physics", new PhysicsComponent(this)
            {
                HasGravity = true
            });
            Components.Add("WorldCollision", new PlayerWorldCollisionComponent(game,this));
            _deathSound = game.Content.Load<SoundEffect>("Sounds/death");
            SetupAnimations();
        }
示例#9
0
        public CartGenerator(MinerGame game)
        {
            _game = game;

            var currentLevel = _game.CurrentLevel;

            _timer = new GameTimer(TimeSpan.FromSeconds(5),true);

            _timer.Tick += CreateNewCarts;

            _tunnelTiles = new List<Tile>();

            foreach (var tile in currentLevel.Tiles)
            {
                if (tile.TileType == ETileType.TunnelStart)
                {
                    _tunnelTiles.Add(tile);
                }
            }

            _newCarts = new List<Cart>();

            _timer.Start();
        }
 public PlayerWorldCollisionComponent(MinerGame game,Player parentObject)
     : base(game, parentObject)
 {
 }
示例#11
0
 public WorldCollisionComponent(MinerGame game,GameObject parentObject)
     : base(parentObject)
 {
     _game = game;
     CollidingTiles = new List<Tile>();
 }
示例#12
0
 public EnemyMachine(MinerGame game)
     : base(game)
 {
 }
 public SimpleEnemyWorldCollisionComponent(MinerGame game, GameObject parentObject)
     : base(game, parentObject)
 {
 }
示例#14
0
 public Collectible(MinerGame game)
     : base(game)
 {
     SetupAnimations();
     State = ECollectibleState.NotCollected;
 }
示例#15
0
文件: Diamond.cs 项目: Bajena/Miner
 public Diamond(MinerGame game)
     : base(game)
 {
     Type = "Diamond";
     _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected");
 }
示例#16
0
文件: MinerHud.cs 项目: Bajena/Miner
 public MinerHud(MinerGame game)
 {
     _game = game;
 }
示例#17
0
文件: Drill.cs 项目: Bajena/Miner
 public Drill(MinerGame game)
     : base(game)
 {
     Type = "Drill";
 }
示例#18
0
 public CartWorldCollisionComponent(MinerGame game,Cart parentObject)
     : base(game,parentObject)
 {
 }
示例#19
0
文件: Level.cs 项目: Bajena/Miner
 /// <summary>
 /// Konstruktor służący do ładowania poziomu oraz odtworzenia zapisanego stanu gry.
 /// </summary>
 /// <param name="game"></param>
 /// <param name="saveData"></param>
 public Level(MinerGame game, SaveData saveData)
 {
     _game = game;
     Name = saveData.LevelName;
     _saveData = saveData;
 }
示例#20
0
文件: Level.cs 项目: Bajena/Miner
 /// <summary>
 /// Konstruktor służący do przekazywania obiektu gracza między poziomami
 /// </summary>
 /// <param name="game"></param>
 /// <param name="name"></param>
 /// <param name="player"></param>
 public Level(MinerGame game, string name, Player player)
 {
     _game = game;
     Name = name;
     Player = player;
 }
示例#21
0
文件: Level.cs 项目: Bajena/Miner
 /// <summary>
 /// Konstruktor. Poziom jest ładowany z pliku xml o tej samej nazwie co parametr name.
 /// </summary>
 /// <param name="game"></param>
 /// <param name="name"></param>
 public Level(MinerGame game, string name)
 {
     _game = game;
     Name = name;
 }
示例#22
0
文件: LifeBonus.cs 项目: Bajena/Miner
 public LifeBonus(MinerGame game)
     : base(game)
 {
     Type = "DynamiteCollectible";
     _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected");
 }
示例#23
0
 public OxygenBottle(MinerGame game)
     : base(game)
 {
     Type = "OxygenBottle";
     _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected");
 }
示例#24
0
 /// <summary>
 /// Konstruktor. Przyjmuje jako parametry obiekt gry oraz obiekt z zserializowanymi danymi poziomu
 /// </summary>
 /// <param name="game">Obiekt gry</param>
 /// <param name="levelData">Dane poziomu</param>
 public GameObjectFactory(MinerGame game,LevelData levelData)
 {
     _game = game;
     _levelData = levelData;
 }
示例#25
0
文件: Coin.cs 项目: Bajena/Miner
 public Coin(MinerGame game)
     : base(game)
 {
     Type = "Coin";
     _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected");
 }
示例#26
0
 public RandomBonus(MinerGame game)
     : base(game)
 {
     Type = "RandomBonus";
     _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected");
 }