public EnemyBugHorizontal(Level pLevel, float pStartY) : base("robobug.png", 2, 3, pLevel, EnemyPoints.floater, EnemyHealth.floater) { startY = pStartY; SetOrigin(width / 2, height / 2); _bugDeathTimer = 1f; }
public EnemyBugVertical(Level pLevel) : base("robobug.png", 2, 2, pLevel) { _level = pLevel; SetOrigin(width / 2, height / 2); scaleX *= -1; }
public NameInput(Level pLevel) { _level = pLevel; ButtonCreator(); mouse = new Mouse(); AddChild(mouse); }
public EnemyBullet(EnemyDirection pDirection, Level pLevel) : base("enemybullet.png") { _level = pLevel; direction = pDirection; _level.enemyBulletList.Add(this); }
/// <summary> /// Destroys the current level and creates the next one as child of game. /// if there is no next level it will instead go back to the menu /// </summary> public void InstantNextLevel() { _currentLevel += 1; //check if the level exists foreach (string filename in _levelList.GetLevels()) { if (filename.Replace ("Level", "") == _currentLevel.ToString ()) { level = new Level (_currentLevel); game.AddChild (level); Console.WriteLine ("Next Level"); Destroy (); return; } } //if the level doesn't exist, load the menu foreach (GameObject child in game.GetChildren()) { if (child is Menu) { Menu menu = child as Menu; menu.visible = true; menu.setPaused (true); } } //remove the current level this.Destroy (); }
public EnemyBugVertical(Level pLevel, float pStartX) : base("robobug.png", 2, 3, pLevel, EnemyPoints.floater, EnemyHealth.floater) { _startX = pStartX; SetOrigin(width / 2, height / 2); _bugDeathTimer = 1f; }
public Player(Level pLevel) : base("player.png", 4, 10) { if (MyGame.playerHasWeapon) { hasWeapon = true; } SetOrigin(width / 2, height); _level = pLevel; }
public PlayerBullet(PlayerDirection pDirection, Level pLevel) : base("playerbullet.png") { _level = pLevel; _direction = pDirection; SetOrigin(width / 2, height / 2); moveDirection(); }
public NameInput(Level pLevel) { _level = pLevel; _game = _level.thisgame; drawInput(); AddChild(_drawer); _drawer.SetXY(413, 120); }
public LevelHUD(Level pLevel) : base("hud.png", 1, 4) { _level = pLevel; _game = pLevel.thisgame; drawer = new Drawer(1024, 100); AddChild(drawer); game.Remove(this); game.Add(this); }
public Enemy(string pFileName, int pColumns, int pRows, Level pLevel, EnemyPoints pPoints, EnemyHealth pHealth, EnemyDirection pEnemyDirection = EnemyDirection.left, bool pMirrow = true) : base(pFileName, pColumns, pRows) { _level = pLevel; _state = EnemyState.idle; _points = pPoints; _healthmax = pHealth; _health = (float)_healthmax; _enemyDirection = pEnemyDirection; Mirror(pMirrow, false); _hitTimer = 0f; _idleTimer = 0f; _deathHitAnimationTimer = 0; }
//speed at wich the frames change //private float _frameSpeed = 0.2f; public EnemyFloater(Level pLevel) : base("robofloater.png", 4, 3, pLevel) { SetOrigin(width / 2, height / 2); scaleX *= -1; }
public PickUpReload(Level pLevel) : base("reloadset.png", 4, 1) { _level = pLevel; }
public PickUpWeapon(Level pLevel) : base("weaponset.png", 4, 1) { _level = pLevel; }
public Camera(Player pObjectToFollow, Level pMap) { _objectToFollow = pObjectToFollow; _map = pMap; }
public PickUpCoin(Level pLevel) : base("coinset.png", 4, 1) { _level = pLevel; }
/// <summary> /// Checkpoint class. Creates an sprite with collision with the player. /// A checkpoint can be a finish point as well. /// </summary> /// <param name="pFileName"> /// This defines the animated image of the checkpoint /// </param> /// <param name="pThisIsCheckPoint"> /// This defines wether this object is a checkpoint or a finishflag /// </param> /// <param name="pLevel"> /// Passes through the leveldata /// </param> public Checkpoints(string pFileName, bool pThisIsCheckPoint, Level pLevel) : base(pFileName, 10, 10) { _level = pLevel; _thisIsCP = pThisIsCheckPoint; }
public EnemySpider(Level pLevel) : base("robospider.png", 4, 3, pLevel, EnemyPoints.floater, EnemyHealth.floater) { SetOrigin(width / 2, 0); }
public PickUpLife(Level pLevel) : base("lifeupset.png", 4, 1) { _level = pLevel; }
public SolidObject(Level pLevel) : base("tileset.png", 32, 66) { _level = pLevel; }
public Enemy(string pFileName, int pColumns, int pRows, Level pLevel) : base(pFileName, pColumns, pRows) { _level = pLevel; }
public InvisBlock(Level pLevel) : base("tileset.png") { _level = pLevel; }
/// <summary> /// Resets the level. /// </summary> public void ResetLevel() { //update the lives so the correct number is taken trought the reset _lives = _player.getLives (); Level level = new Level (_currentLevel, _lives); game.AddChild (level); Console.WriteLine ("reset"); this.Destroy (); }
public Checkpoints(bool pThisIsCheckPoint, Level pLevel) : base("checkpoint.png", 6, 1) { _level = pLevel; _thisIsCP = pThisIsCheckPoint; }
/// <summary> /// Loads the selected level. /// </summary> /// <param name="levelName">Level name.</param> protected void playLevel(string levelName) { _paused = false; //Check if a level exists, if it does destroy it foreach (GameObject child in game.GetChildren()) { if (child is Menu) { Menu menu = child as Menu; menu.visible = false; menu.setPaused (false); } if (child is Level) { child.Destroy (); break; } } //turns levelname to a number for easy parsing Level level = new Level (int.Parse (levelName.Replace ("Level", ""))); //adds the level to game game.AddChild (level); //hides the menu this.visible = false; }