Example #1
0
 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;
 }
Example #2
0
 public EnemyBugVertical(Level pLevel)
     : base("robobug.png", 2, 2, pLevel)
 {
     _level = pLevel;
     SetOrigin(width / 2, height / 2);
     scaleX *= -1;
 }
Example #3
0
 public NameInput(Level pLevel)
 {
     _level = pLevel;
     ButtonCreator();
     mouse = new Mouse();
     AddChild(mouse);
 }
Example #4
0
 public EnemyBullet(EnemyDirection pDirection, Level pLevel)
     : base("enemybullet.png")
 {
     _level = pLevel;
     direction = pDirection;
     _level.enemyBulletList.Add(this);
 }
Example #5
0
        /// <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 ();
        }
Example #6
0
 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;
 }
Example #7
0
        public Player(Level pLevel)
            : base("player.png", 4, 10)
        {
            if (MyGame.playerHasWeapon) { hasWeapon = true; }

            SetOrigin(width / 2, height);
            _level = pLevel;
        }
Example #8
0
        public PlayerBullet(PlayerDirection pDirection, Level pLevel)
            : base("playerbullet.png")
        {
            _level = pLevel;
            _direction = pDirection;

            SetOrigin(width / 2, height / 2);
            moveDirection();
        }
Example #9
0
        public NameInput(Level pLevel)
        {
            _level = pLevel;
            _game = _level.thisgame;

            drawInput();

            AddChild(_drawer);
            _drawer.SetXY(413, 120);
        }
Example #10
0
        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);
        }
Example #11
0
File: Enemy.cs Project: mbos14/GTFO
 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;
 }
Example #12
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;
 }
Example #13
0
 public PickUpReload(Level pLevel)
     : base("reloadset.png", 4, 1)
 {
     _level = pLevel;
 }
Example #14
0
 public PickUpWeapon(Level pLevel)
     : base("weaponset.png", 4, 1)
 {
     _level = pLevel;
 }
Example #15
0
 public Camera(Player pObjectToFollow, Level pMap)
 {
     _objectToFollow = pObjectToFollow;
     _map = pMap;
 }
Example #16
0
 public PickUpCoin(Level pLevel)
     : base("coinset.png", 4, 1)
 {
     _level = pLevel;
 }
Example #17
0
 /// <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;
 }
Example #18
0
 public EnemySpider(Level pLevel)
     : base("robospider.png", 4, 3, pLevel, EnemyPoints.floater, EnemyHealth.floater)
 {
     SetOrigin(width / 2, 0);
 }
Example #19
0
 public PickUpLife(Level pLevel)
     : base("lifeupset.png", 4, 1)
 {
     _level = pLevel;
 }
Example #20
0
 public SolidObject(Level pLevel)
     : base("tileset.png", 32, 66)
 {
     _level = pLevel;
 }
Example #21
0
File: Enemy.cs Project: mbos14/GTFO
 public Enemy(string pFileName, int pColumns, int pRows, Level pLevel)
     : base(pFileName, pColumns, pRows)
 {
     _level = pLevel;
 }
Example #22
0
 public InvisBlock(Level pLevel)
     : base("tileset.png")
 {
     _level = pLevel;
 }
Example #23
0
        /// <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 ();
        }
Example #24
0
 public Checkpoints(bool pThisIsCheckPoint, Level pLevel)
     : base("checkpoint.png", 6, 1)
 {
     _level = pLevel;
     _thisIsCP = pThisIsCheckPoint;
 }
Example #25
0
        /// <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;
        }