public Machine(MinerGame game) : base(game) { SetupAnimations(); State = EMachineState.Normal; _pointsForKill = 0; }
public Dynamite(MinerGame game, TimeSpan timeToExplosion) : base(game) { Type = "Dynamite"; _timeToExplosion = timeToExplosion; Initialize(); }
public Dynamite(MinerGame game) : base(game) { Type = "Dynamite"; _timeToExplosion = TimeSpan.FromSeconds(1); Initialize(); }
protected Explosive(MinerGame game) : base(game) { _explodeSound = game.Content.Load<SoundEffect>("Sounds/explode"); State = EExplosiveState.Idle; SetupAnimations(); }
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); }
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)); }
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; }
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(); }
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) { }
public WorldCollisionComponent(MinerGame game,GameObject parentObject) : base(parentObject) { _game = game; CollidingTiles = new List<Tile>(); }
public EnemyMachine(MinerGame game) : base(game) { }
public SimpleEnemyWorldCollisionComponent(MinerGame game, GameObject parentObject) : base(game, parentObject) { }
public Collectible(MinerGame game) : base(game) { SetupAnimations(); State = ECollectibleState.NotCollected; }
public Diamond(MinerGame game) : base(game) { Type = "Diamond"; _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected"); }
public MinerHud(MinerGame game) { _game = game; }
public Drill(MinerGame game) : base(game) { Type = "Drill"; }
public CartWorldCollisionComponent(MinerGame game,Cart parentObject) : base(game,parentObject) { }
/// <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; }
/// <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; }
/// <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; }
public LifeBonus(MinerGame game) : base(game) { Type = "DynamiteCollectible"; _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected"); }
public OxygenBottle(MinerGame game) : base(game) { Type = "OxygenBottle"; _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected"); }
/// <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; }
public Coin(MinerGame game) : base(game) { Type = "Coin"; _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected"); }
public RandomBonus(MinerGame game) : base(game) { Type = "RandomBonus"; _collectedSound = game.Content.Load<SoundEffect>("Sounds/key_collected"); }