Exemplo n.º 1
0
 public Idle(Explorer explorer, float angle)
     : base(explorer)
 {
     this.explorer = explorer;
     this.angle = angle;
     i = 1;
 }
Exemplo n.º 2
0
 //Constructor
 public Left(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.angle = (float)Math.PI;
     this.i = 0;
 }
Exemplo n.º 3
0
 //Constructor
 public Down(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.angle = (float)Math.PI / 2;
     this.i = 0;
 }
Exemplo n.º 4
0
 //properties
 //constructor
 public Right(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.angle = this.angle = -(float)Math.PI * 2;
     this.i = 0;
 }
Exemplo n.º 5
0
 // Constructor van deze toestands class krijgt altijd het object mee
 // van de hoofdclass Explorer als argument
 public ExplorerWalkLeft(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.velocity = new Vector2(this.explorer.Speed, 0f);
     this.effect = SpriteEffects.FlipHorizontally;
 }
Exemplo n.º 6
0
 //LoadContent
 public void LoadContent()
 {
     this.beetle = new Beetle(this.game, new Vector2(200f, 300f), 2);
     this.beetle1 = new Beetle(this.game, new Vector2(50f, 200f), 3);
     this.scorpion = new Scorpion(this.game, new Vector2(100f, 300f), 2);
     this.scorpion1 = new Scorpion(this.game, new Vector2(10f, 150f), 3);
     this.explorer = new Explorer(this.game, new Vector2(304f, 224f), 2);
 }
 // Constructor van deze toestands class krijgt altijd het object mee
 // van de hoofdclass Explorer als argument
 public ExplorerWalkDown(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.velocity = new Vector2(0f, this.explorer.Speed);
     this.effect = SpriteEffects.None;
     this.rotation = (float)Math.PI / 2;
 }
Exemplo n.º 8
0
 // LoadContent methode. Deze methode maakt nieuwe objecten aan van de verschillende
 // classes.
 public void LoadContent()
 {
     this.beetle = new Beetle(this.game, new Vector2(100f, 300f));
     this.beetle1 = new Beetle(this.game, new Vector2(400f, 100f));
     this.scorpion = new Scorpion(this.game, new Vector2(300f, 188f));
     this.scorpion1 = new Scorpion(this.game, new Vector2(188f, 300f));
     this.explorer = new Explorer(this.game, new Vector2(0f, 240f));
 }
 // Constructor van deze toestands class krijgt altijd het object mee
 // van de hoofdclass Explorer als argument
 public ExplorerWalkRight(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.velocity = new Vector2(this.explorer.Speed, 0f);
     this.effect = SpriteEffects.None;
     this.imageNumber = 1;
     this.sourceRect = new Rectangle(this.imageNumber * 32, 0, 32, 32);
 }
Exemplo n.º 10
0
 //Contstructor
 public ExplorerWalkRight(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.destinationRectangle = new Rectangle((int)this.explorer.Position.X,
                                               (int)this.explorer.Position.Y,
                                               32,
                                               32);
     this.velocity = new Vector2(this.explorer.Speed, 0f);
 }
Exemplo n.º 11
0
 // Constructor van deze toestands class krijgt altijd het object mee
 // van de hoofdclass Explorer als argument
 public ExplorerWalkUp(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.velocity = new Vector2(0f, this.explorer.Speed);
     this.effect = SpriteEffects.None;
     this.imageNumber = 1;
     this.sourceRect = new Rectangle(this.imageNumber * 32, 0, 32, 32);
     this.rotation = -(float)Math.PI / 2;
 }
Exemplo n.º 12
0
 //Constructor
 public ExplorerIdle(Explorer explorer)
     : base(explorer)
 {
     // explorer
     this.explorer = explorer;
     // nieuwe rectangle aangemaakt
     this.destinationRectangle = new Rectangle((int)this.explorer.Position.X, (int)this.explorer.Position.Y, 32, 32);
     this.sourceRectangle = new Rectangle(this.imageNumber * 32, 0, 32, 32);
     this.velocity = new Vector2(this.explorer.Speed, 0f);
 }
Exemplo n.º 13
0
 //Constructor
 public ExplorerIdle(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.destinationRectangle = new Rectangle((int)this.explorer.Position.X,
                                               (int)this.explorer.Position.Y,
                                               32,
                                               32);
     this.sourceRectangle = new Rectangle(this.imageNumber * 32, 0, 32, 32);
     this.velocity = new Vector2(0f, 0f);
 }
Exemplo n.º 14
0
 //Contstructor
 public ExplorerWalkLeft(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.destinationRectangle = new Rectangle((int)this.explorer.Position.X,
                                               (int)this.explorer.Position.Y,
                                               32,
                                               32);
     this.velocity = new Vector2(this.explorer.Speed, 0f);
     this.effect = SpriteEffects.FlipHorizontally;
 }
 //Contstructor
 public ExplorerWalkDown(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.destinationRectangle = new Rectangle((int)this.explorer.Position.X,
                                               (int)this.explorer.Position.Y,
                                               32,
                                               32);
     this.velocity = new Vector2(0f, this.explorer.Speed);
     this.rotation = (float)Math.PI / 2;
 }
Exemplo n.º 16
0
 //Constructor
 public ExplorerIdle(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.destinationRect = new Rectangle((int)this.explorer.Position.X,
                                         (int)this.explorer.Position.Y,
                                         32,
                                         32);
     this.velocity = new Vector2(this.explorer.Speed, 0f);
     this.imageNumber = 1;
 }
 public void Update(GameTime gameTime, Explorer explorer)
 {
     //Speeddown
     this.block.Location += new Vector2(0f, 0.9f);
     //Weer terug duwen omhoog
     MovingBlockManager.CollisionDectectExplorerMovingBlockUp(this.block);
     //Als de explorer stilstaat word het blokje tegengehouden
     MovingBlockManager.CollisionDectectExplorerGoBackUp(this.block);
     //Zet het blokje weer op de oude plaats
     MovingBlockManager.SetBackOnPlaceGoingDown(this.block);
 }
Exemplo n.º 18
0
 //Contstructor
 public ExplorerWalkUp(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.destinationRectangle = new Rectangle((int)this.explorer.Position.X,
                                               (int)this.explorer.Position.Y,
                                               32,
                                               32);
     this.velocity = new Vector2(0f, this.explorer.Speed);
     this.effect = SpriteEffects.FlipHorizontally;
     this.rotation = (float)Math.PI / 2;
 }
Exemplo n.º 19
0
 // LoadContent methode. Deze methode maakt nieuwe objecten aan van de verschillende
 // classes.
 public void LoadContent()
 {
     this.beetle = new Beetle(this.game, new Vector2(100f, 300f));
     this.beetle1 = new Beetle(this.game, new Vector2(400f, 100f));
     this.scorpion = new Scorpion(this.game, new Vector2(300f, 188f));
     this.scorpion1 = new Scorpion(this.game, new Vector2(188f, 300f));
     this.explorer = new Explorer(this.game, new Vector2(304f, 240f));
     this.block1 = new Block(this.game,@"Block\Block", new Vector2(0f, 0f));
     this.block2 = new Block(this.game, @"Block\Wall1", new Vector2(32f, 32f));
     this.block3 = new Block(this.game, @"Block\Wall2", new Vector2(0f, 32f));
     this.block4 = new Block(this.game, @"Block\Door", new Vector2(32f, 0f));
 }
Exemplo n.º 20
0
        //Contstructor
        public ExplorerWalkUp(Explorer explorer)
            : base(explorer)
        {
            this.explorer = explorer;

            this.destinationRectangle = new Rectangle((int)this.explorer.Position.X,
                                                      (int)this.explorer.Position.Y,
                                                      32,
                                                      32);
            this.velocity = new Vector2(0f, this.explorer.Speed);
            //zorgt dat de explorer omhoog kijkt
            this.rotation = (float)Math.PI / -2;
        }
Exemplo n.º 21
0
        public void Update(GameTime gameTime, Explorer explorer)
        {
            this.block.Location = explorer.Position - new Vector2(0f, 32f);

            if (explorer.State.ToString() == "pp.Idle")
            {
                this.block.State = new MovingBlockIdleOffPlace(this.block);
            }
            if (MovingBlockManager.CollisionDectectionWalls(this.block))
            {
                this.block.State = new MovingBlockIdleOffPlace(this.block);
            }
        }
Exemplo n.º 22
0
 //Properties
 //Constructor
 public IdleMovingBlockIdle(Explorer explorer, string direction)
     : base(explorer)
 {
     this.explorer = explorer;
     this.direction = direction;
     this.i = 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)
 {
     MovingBlockManager.CollisionDectectExplorerMovingBlockDown(this.block);
     MovingBlockManager.CollisionDectectExplorerMovingBlockUp(this.block);    //§
     MovingBlockManager.DeCollisionDectectExplorerMovingBlockDown(this.block); //§ aangepast
 }
Exemplo n.º 24
0
        private Tile loadTile(char blockElement, int x , int y)
        {
            switch (blockElement)
            {
                case 'B':
                    this.beetleList.Add(new Beetle(this.game, new Vector2(x, y), 2.0f));
                    return new Tile(this.game, @"Transparant", new Vector2(x, y), TileCollision.Passable, 'b');
                case 'E':
                   this.explorer = new Explorer(this.game,new Vector2(x,y),2.5f);
                    return new Tile(this.game, @"Transparant", new Vector2(x, y), TileCollision.Passable, 'E');
                case 'S':
                    this.scorpionList.Add(new Scorpion(this.game, new Vector2(x, y), 2.0f));
             	                 return new Tile(this.game, @"Transparant", new Vector2(x, y), TileCollision.Passable, 's');

                case 'a':
                    this.treasures.Add(new Treasure('a',this.game, new Vector2(x, y),@"PlaySceneAssets\pickups\Scarab"));//scarab
                    return new Tile(this.game, @"transparant", new Vector2(x, y), TileCollision.Passable, 'a');
                case 'b':
                    this.treasures.Add(new Treasure('b',this.game, new Vector2(x, y), @"PlaySceneAssets\pickups\Potion"));//potions
                    return new Tile(this.game, @"transparant", new Vector2(x, y), TileCollision.Passable, 'b');
                case 'c':
                    this.treasures.Add(new Treasure('c',this.game, new Vector2(x, y), @"PlaySceneAssets\pickups\Treasure2"));//cat
                    return new Tile(this.game, @"transparant", new Vector2(x, y), TileCollision.Passable, 'c');
                case 'd':
                    this.treasures.Add(new Treasure('d',this.game, new Vector2(x, y), @"PlaySceneAssets\pickups\Treasure1"));//ankh
                    return new Tile(this.game, @"transparant", new Vector2(x, y), TileCollision.Passable, 'd');
                case '@':
                    this.background = new Image(this.game, new Vector2(x,y),@"PlaySceneAssets\background\Background2");
                    return new Tile(this.game, @"Wall2", new Vector2(x, y), TileCollision.Notpassable, '@');

                case 'x':
                    return new Tile(this.game, @"Wall1", new Vector2(x, y), TileCollision.Notpassable, 'x');
                case 'y':
                    return new Tile(this.game, @"Wall2", new Vector2(x, y), TileCollision.Notpassable, 'y');
                case 'w':
                    return new Tile(this.game,@"Block",new Vector2(x,y),TileCollision.Notpassable,'w');
                case '.':
                        return new Tile(this.game,@"transparant", new Vector2(x,y),TileCollision.Passable,'.');
                case 'D':
                        return new Tile(this.game, @"Door", new Vector2(x, y), TileCollision.Passable, 'd');
                default:
                    return new Tile(this.game, @"transparant", new Vector2(x, y), TileCollision.Passable, '.');

            }
        }
Exemplo n.º 25
0
 public void Update(GameTime gameTime, Explorer explorer)
 {
     this.state.Update(gameTime, explorer);
 }
Exemplo n.º 26
0
 //Constructor
 public Right(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
     this.i = 0;
 }
Exemplo n.º 27
0
 //Properties
 //Constructor
 public Idle(Explorer explorer)
     : base(explorer)
 {
     this.explorer = explorer;
 }
Exemplo n.º 28
0
 private Block LoadBlock(char blockElement, int x, int y)
 {
     switch (blockElement)
     {
         case 'a':
             this.treasures.Add(new Treasure('a', this.game, @"PlaySceneAssets\Treasures\Treasure1", new Vector2(x, y)));
             return new Block(this.game, @"Transparant", new Vector2(x, y), BlockCollision.Passable, 'a');
         case 'b':
             this.treasures.Add(new Treasure('b', this.game, @"PlaySceneAssets\Treasures\Treasure2", new Vector2(x, y)));
             return new Block(this.game, @"Transparant", new Vector2(x, y), BlockCollision.Passable, 'b');
         case 'c':
             this.treasures.Add(new Treasure('c', this.game, @"PlaySceneAssets\Treasures\Potion", new Vector2(x, y)));
             return new Block(this.game, @"Transparant", new Vector2(x, y), BlockCollision.Passable, 'c');
         case 'd':
             this.treasures.Add(new Treasure('d', this.game, @"PlaySceneAssets\Treasures\Scarab", new Vector2(x, y)));
             return new Block(this.game, @"Transparant", new Vector2(x, y), BlockCollision.Passable, 'd');
         case 'w':
             return new Block(this.game, @"Block", new Vector2(x, y), BlockCollision.NotPassable, 'w');
         case 'x':
             return new Block(this.game, @"Wall1", new Vector2(x, y), BlockCollision.NotPassable, 'x');
         case 'y':
             return new Block(this.game, @"Wall2", new Vector2(x, y), BlockCollision.NotPassable, 'y');
         case 'z':
             return new Block(this.game, @"Door", new Vector2(x, y), BlockCollision.NotPassable, 'z');
         case 'B':
             this.beetles.Add(new Beetle(this.game, new Vector2(x, y), 2.0f));
             return new Block(this.game, @"Transparant", new Vector2(x, y), BlockCollision.Passable, 'B');
         case 'S':
             this.scorpions.Add(new Scorpion(this.game, new Vector2(x, y), 2.0f));
             return new Block(this.game, @"Transparant", new Vector2(x, y), BlockCollision.Passable, 'S');
         case 'E':
             this.explorer = new  Explorer (this.game, new Vector2(x, y), 2.0f);
             return new Block(this.game, @"Transparant", new Vector2(x, y), BlockCollision.Passable, 'E');
         case '@':
             this.background = new Image(this.game, @"PlaySceneAssets\Background\Background2", new Vector2(x, y));
             return new Block(this.game, @"Block", new Vector2(x, y), BlockCollision.NotPassable, '@');
         case '.':
             return new Block(this.game, @"Transparant", new Vector2(x, y), BlockCollision.Passable, '.');
         default:
             return new Block(this.game, @"Transparant", new Vector2(x, y), BlockCollision.Passable, '.');
     }
 }
Exemplo n.º 29
0
 public Block LoadBlock(char blockElement, int x, int y)
 {
     switch (blockElement)
     {
         case 's':
             this.scorpions.Add(new Scorpion(this.game, new Vector2(x + 16f, y + 16f)));
             return new Block(this.game, @"Block\Transparant", new Vector2(x, y), true);
         case 'b':
             this.beetles.Add(new Beetle(this.game, new Vector2(x + 16f, y + 16f)));
             return new Block(this.game, @"Block\Transparant", new Vector2(x, y), true);
         case 'c':
             this.treasures.Add(new Image(this.game, @"Treasures\Cat", new Vector2(x, y)));
             return new Block(this.game, @"Block\Transparant", new Vector2(x, y), true);
         case 'a':
             this.treasures.Add(new Image(this.game, @"Treasures\Ankh", new Vector2(x, y)));
             return new Block(this.game, @"Block\Transparant", new Vector2(x, y), true);
         case 'S':
             this.treasures.Add(new Image(this.game, @"Treasures\Scarab", new Vector2(x, y)));
             return new Block(this.game, @"Block\Transparant", new Vector2(x, y), true);
         case 'p':
             this.treasures.Add(new Image(this.game, @"Treasures\potion", new Vector2(x, y)));
             return new Block(this.game, @"Block\Transparant", new Vector2(x, y), true);
         case 'E':
             this.explorer = new Explorer(this.game, new Vector2(x + 16f, y + 16f));
             return new Block(this.game, @"Block\Transparant", new Vector2(x, y), true);
         case 'x':
             return new Block(this.game, @"Block\Block", new Vector2(x, y), false);
         case 'y':
             return new Block(this.game, @"Block\Wall1", new Vector2(x, y), false);
         case 'z':
             return new Block(this.game, @"Block\Wall2", new Vector2(x, y), false);
         case 'v':
             return new Block(this.game, @"Block\Block_hor", new Vector2(x, y), false);
         case 'w':
             return new Block(this.game, @"Block\Block_vert", new Vector2(x, y), false);
         case 'u':
             return new Block(this.game, @"Block\Door", new Vector2(x, y), false);
         case '@':
             this.background = new Image(this.game, @"Background\Background2", new Vector2(x, y));
             return new Block(this.game, @"Block\Block", new Vector2(x, y), false);
         case '.':
             return new Block(this.game, @"Block\Transparant", new Vector2(x, y), true);
         default:
             return new Block(this.game, @"Block\Transparant", new Vector2(x, y), true);
     }
 }