예제 #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
파일: GameObject.cs 프로젝트: Bajena/Miner
        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();
        }
예제 #10
0
 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
파일: Collectible.cs 프로젝트: Bajena/Miner
 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
파일: RandomBonus.cs 프로젝트: Bajena/Miner
 public RandomBonus(MinerGame game)
     : base(game)
 {
     Type = "RandomBonus";
     _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected");
 }