//Properties
 //Constructor
 public ExplorerWalkUp(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.currentFrame = 0;
     this.angle = 2f;
 }
 //Properties
 //Constructor
 public ExplorerWalkLeft(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.currentFrame = 0;
     this.angle = 1f;
     this.explorer.Speed = 2f;
 }
 public void Update(GameTime gameTime, Explorer explorer)
 {
     //Speeddown
     this.block.Location += new Vector2(0.9f, 0f);
     //Weer terug duwen omlaag
     MovingBlockManager.CollisionDectectExplorerMovingBlockDown(this.block);
     //Als de explorer stilstaat word het blokje tegengehouden
     MovingBlockManager.CollisionDectectExplorerGoBackUp(this.block);
     //Zet het blokje weer op de oude plaats
     MovingBlockManager.SetBackOnPlaceGoingUp(this.block);
 }
        public void Update(GameTime gameTime, Explorer explorer)
        {
            this.block.Location = explorer.Location - new Vector2(32f, 0f);

            if (explorer.IState.ToString() == "pp.Idle")
            {
                this.block.State = new MovingBlockIdleOffPlace(this.block);
            }
            if (MovingBlockManager.CollisionDectectionWalls(this.block))
            {
                this.block.State = new MovingBlockIdleOffPlace(this.block);
            }
        }
Beispiel #5
0
 //Properties
 //Constructor
 public Idle(Explorer explorer, string direction)
     : base(explorer)
 {
     this.explorer = explorer;
     this.currentFrame = 1;
     this.direction = new Dictionary<string, float>()
     {
         {"Down", 0f},
         {"Left", 1f},
         {"Up", 2f},
         {"Right", 3f}
     };
     this.angle = this.direction[direction];
 }
 //Properties
 //Constructor
 public IdleExplorerMovingBlockStandStill(Explorer explorer, string direction)
     : base(explorer)
 {
     this.explorer = explorer;
     this.direction = direction;
     this.currentFrame = 1;
     this.directionDictionary = new Dictionary<string, float>()
     {
         {"Down", 0f},
         {"Left", 1f},
         {"Up", 2f},
         {"Right", 3f}
     };
     this.angle = this.directionDictionary[direction];
 }
 public void Update(GameTime gameTime, Explorer explorer)
 {
     this.state.Update(gameTime, explorer);
 }
Beispiel #8
0
 private Block LoadBlock(char blockElement, int letter, int regel)
 {
     switch (blockElement)
     {
         case '@':
             this.background = new Image(this.game, @"PlaySceneAssets\Background\background2",
                                             Vector2.Zero, '@');
             return new Block(this.game, "Wall1", new Vector2(letter, regel),
                                 BlockCollision.NotPassable, '@');
         case 'a':
             this.treasures.Add(new Image(this.game, @"PlaySceneAssets\Treasures\Treasure1",
                 new Vector2(letter, regel), 'a'));
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.Passable, 'a');
         case 'B':
             this.beetles.Add(new Beetle(this.game, new Vector2(letter, regel), 4, 1, 4, 120));
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.Passable, 'B');
         case 'c':
             this.treasures.Add(new Image(this.game, @"PlaySceneAssets\Treasures\Treasure2",
                 new Vector2(letter, regel), 'c'));
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.Passable, 'c');
         case 'h':
             this.movingBlocks.Add( new MovingBlock(this.game, "Block_vert", new Vector2(letter, regel),
                                 BlockCollision.NotPassable, 'h'));
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.NotPassable, 'h');
         case 'v':
             this.movingBlocks.Add(new MovingBlock(this.game, "Block_hor", new Vector2(letter, regel),
                                 BlockCollision.NotPassable, 'v'));
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.NotPassable, 'v');
         case 'M':
             this.mummies.Add(new Mummy(this.game, new Vector2(letter, regel), 4, 1, 4, 120));
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.Passable, 'M');
         case 'E':
             this.explorer = new Explorer(this.game, new Vector2(letter, regel), 4, 1, 3, 2f);
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.Passable, 'E');
         case 'p':
             this.treasures.Add(new Image(this.game, @"PlaySceneAssets\Treasures\Potion",
                 new Vector2(letter, regel), 'p'));
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.Passable, 'p');
         case 's':
             this.treasures.Add(new Image(this.game, @"PlaySceneAssets\Treasures\Scarab",
                 new Vector2(letter, regel), 's'));
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.Passable, 's');
         case 'S':
             this.scorpions.Add(new Scorpion(this.game, new Vector2(letter, regel), 4, 1, 6, 120));
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.Passable, 'S');
         case '.':
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.Passable, '.');
         case 'w':
             return new Block(this.game, "Wall1", new Vector2(letter, regel),
                                 BlockCollision.NotPassable, 'w');
         case 'x':
             return new Block(this.game, "Wall2", new Vector2(letter, regel),
                                 BlockCollision.NotPassable, 'x');
         case 'y':
             return new Block(this.game, "Block", new Vector2(letter, regel),
                                 BlockCollision.NotPassable, 'y');
         case 'z':
             return new Block(this.game, "Door", new Vector2(letter, regel),
                                 BlockCollision.Passable, 'z');
         default:
             return new Block(this.game, "Transparant", new Vector2(letter, regel),
                                 BlockCollision.Passable, '.');
     }
 }
 public void Update(GameTime gameTime, Explorer explorer)
 {
     MovingBlockManager.CollisionDectectExplorerMovingBlockDown(this.block);
     MovingBlockManager.CollisionDectectExplorerMovingBlockUp(this.block);               //§
 }
Beispiel #10
0
 public void Update(GameTime gameTime, Explorer explorer)
 {
     if ( this.blockCollision == BlockCollision.Passable )
         this.texture = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\Blocks\" + this.blockName);
      if ( this.BlockCollision == BlockCollision.NotPassable )
          this.texture = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\Blocks\Door");
 }