Beispiel #1
0
 //Constructor
 public Image(PyramidPanic game,Vector2 position,string pathName)
 {
     this.game = game;
      this.position = position;
      this.texture = game.Content.Load<Texture2D>(pathName);
      this.rectangle = new Rectangle((int)this.position.X,(int)this.position.Y,this.texture.Width,this.texture.Height);
 }
        // Constructor van de StartScene-class krijgt een object game mee van het type PyramidPanic
        public StartScene(PyramidPanic game)
        {
            this.game = game;

            // Roep de Initialize method aan
            this.Initialize();
        }
 static void Main(string[] args)
 {
     using (PyramidPanic game = new PyramidPanic())
     {
         game.Run();
     }
 }
Beispiel #4
0
 //Properties
 //Constructor
 public Scorpion(PyramidPanic game)
 {
     this.game = game;
     this.texture = this.game.Content.Load<Texture2D>(@"PlayScene/Scorpion");
     this.sourceRectangle = new Rectangle(0, 0, 32, 32);
     this.destinationRectangle = new Rectangle(100, 200, this.texture.Width/4, this.texture.Height);
 }
 //Constructor
 public StartScene(PyramidPanic game)
 {
     this.game = game;
     this.background = new Image(game, @"StartSceneAssets\Background", Vector2.Zero);
     this.title = new Image(game, @"StartSceneAssets\Title", new Vector2(110f, 30f));
     this.menu = new MenuStartScene(this.game);
 }
Beispiel #6
0
        //Constructor
        public Level(PyramidPanic game, int levelIndex)
        {
            this.game = game;
            this.levelIndex = levelIndex;
            /*
            System.IO.Stream stream = TitleContainer.OpenStream(@"Content\PlaySceneAssets\Levels\0.txt");
            System.IO.StreamReader sreader = new System.IO.StreamReader(stream);
            // use StreamReader.ReadLine or other methods to read the file data

            Console.WriteLine("File Size: " + stream.Length);
            stream.Close();
            */

            this.levelPath = @"Content\PlaySceneAssets\Levels\" + levelIndex + ".txt";
            this.stream = TitleContainer.OpenStream(this.levelPath);
            //this.levelPath = @"Content\PlaySceneAssets\Levels\0.txt";
            //this.levelPath = @"Content\PlaySceneAssets\Levels\" + levelIndex + ".txt";

            //eeee
            //IAsyncResult result = StorageDevice.BeginShowSelector(
            //        PlayerIndex.One, null, null);
            //StorageDevice device = StorageDevice.EndShowSelector(result);
            //device.BeginOpenContainer.

            //eeeee
            this.LoadAssets();
            ExplorerManager.Explorer = this.explorer;
            this.levelPause = new LevelPause(this);
            this.levelPlay = new LevelPlay(this);
            this.levelDoorOpen = new LevelDoorOpen(this);
            this.levelGameOver = new LevelGameOver(this);
            this.levelNextLevel = new LevelNextLevel(this);
            this.levelState = this.levelPlay;
            this.stream.Close();
        }
Beispiel #7
0
 //construction
 public Level(PyramidPanic game,int levelIndex)
 {
     this.game = game;
     this.levelPath = @"Content\PlaySceneAssets\Levels\"+levelIndex+".txt";
     this.loadAssets();
     Score.initialize();
 }
        //Maak een variabele (reference) aan van de Menu class genaamd menu
        // Constructor van StartScene-class krijgt een object game mee van het type PyramidPanic
        public ScoreScene(PyramidPanic game)
        {
            this.game = game;

            //roep de initialize method aan
            this.initialize();
        }
Beispiel #9
0
 // constructor
 public StartScene(PyramidPanic game)
 {
     this.game = game;
     this.background = new Image(game, Vector2.Zero, "StartMenu//background");
     this.title = new Image(game, new Vector2(100f, 30f), "StartMenu//Title");
     this.menu = new MenuStartScene(this.game);
     PlayScene.LevelNumber = 0;
 }
Beispiel #10
0
 //Constructors
 public Explorder(PyramidPanic game)
     : base(game)
 {
     this.game = game;
     this.texture = game.Content.Load<Texture2D>(@"Explorder\Explorer");
     this.destinationRectangle.X = 0;
     this.destinationRectangle.X = 150;
 }
Beispiel #11
0
 //Constuctor
 public Block(PyramidPanic game, string blockName,
         Vector2 position, BlockCollision blockCollision, Char charItem)
 {
     this.game = game;
     this.texture = game.Content.Load<Texture2D>(@"PlaySceneAssets\Block\" + blockName);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, this.texture.Width, this.texture.Height);
     this.position = position;
     this.charItem = charItem;
 }
Beispiel #12
0
 //Constructor
 public Scorpion(PyramidPanic game, string pathName, Vector2 position, float speed)
 {
     this.game = game;
     this.texture = game.Content.Load<Texture2D>(@"PlaySceneAssets\Scorpion\Scorpion");
     this.position = position;
     this.speed = speed;
     this.rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, this.texture.Width/4, this.texture.Height);
     this.state = new WalkLeft(this);
 }
Beispiel #13
0
 //constructor
 public Scorpion(PyramidPanic game, Vector2 position)
 {
     this.game = game;
     this.position = position;
     this.texture = game.Content.Load<Texture2D>(@"Scorpion/Scorpion");
     this.walkLeft = new WalkLeft(this);
     this.walkRight = new WalkRight(this);
     this.state = walkLeft;
 }
Beispiel #14
0
 //constructor
 public Image(PyramidPanic game, String pathnameAsset, Vector2 position)
 {
     this.game = game;
     this.texture = game.Content.Load<Texture2D>(pathnameAsset);
     this.rectangle = new Rectangle((int)position.X,
                                    (int)position.Y,
                                    this.texture.Width,
                                    this.texture.Height);
 }
Beispiel #15
0
        // Constructor
        public Level(PyramidPanic game, int levelIndex)
        {
            this.game = game;
            this.levelIndex = levelIndex;

            //Laad het textbestand met behulp van een stream object
            this.stream = TitleContainer.OpenStream(@"Content\Level\0.txt");
            this.LoadAssets();
        }
Beispiel #16
0
 //Constructor
 public Beetle(PyramidPanic game, Vector2 position, float speed)
 {
     this.game = game;
     this.texture = game.Content.Load<Texture2D>(@"PlaySceneAssets\Beetles\Beetle");
     this.speed = speed;
     this.position = position;
     this.rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, this.texture.Width/4, this.texture.Height);
     this.state = new WalkUp(this);
 }
Beispiel #17
0
 //Constructor
 public Beetle(PyramidPanic game, Vector2 position)
 {
     this.game = game;
     this.position = position;
     this.texture = game.Content.Load<Texture2D>(@"Beetle\Beetle");
     this.walkUp = new WalkUp(this);
     this.walkDown = new WalkDown(this);
     this.state = this.walkUp;
 }
Beispiel #18
0
 //Constructor
 public PlayScene(PyramidPanic game)
 {
     this.game = game;
     if (levelNumber == 0 || Score.isDead())
     {
         levelNumber = 0;
         Score.Initialize();
     }
     this.Initialize();
 }
Beispiel #19
0
 /* Dit is de constructor van de Image class. Hij is meestal public, heeft
  * dezelfde naam als de class en heeft geen returntype.
  */
 public Image(PyramidPanic game, string pathNameAsset, Vector2 position)
 {
     // Geef de het game object mee aan het field this.game
     this.game = game;
     this.texture = game.Content.Load<Texture2D>(pathNameAsset);
     this.rectangle = new Rectangle((int)position.X,
                                    (int)position.Y,
                                    this.texture.Width,
                                    this.texture.Height);
 }
Beispiel #20
0
 //Constructor
 public HelpScene(PyramidPanic game)
 {
     this.game = game;
     this.background = new Image(this.game, @"PlaySceneAssets/background/Background2", Vector2.Zero);
     this.text = game.Content.Load<Texture2D>(@"PlaySceneAssets/Helper/help");
     this.rectangle1 = new Rectangle(300, 0, 40, 40);
     this.rectangle2 = new Rectangle(295, 420, 40, 40);
     this.position = Vector2.Zero;
     this.Initialize();
 }
Beispiel #21
0
 public Tile(PyramidPanic game,string tileName
                             ,Vector2 position,TileCollision tileCollision,char charItem)
 {
     this.game = game;
     this.tileCollision = tileCollision;
     this.texture = game.Content.Load<Texture2D>(@"PlaySceneAssets\tiles\"+tileName);
     this.position = position;
     this.rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, texture.Width, texture.Height);
     this.charItem = charItem;
 }
Beispiel #22
0
 // Maak de constructor
 public Scorpion(PyramidPanic game, Vector2 position, int speed)
 {
     this.position = position;
     this.game = game;
     this.speed = speed;
     this.texture = this.game.Content.Load<Texture2D>(@"PlayScene\Scorpion");
     this.walkRight = new WalkRight(this);
     this.walkLeft = new WalkLeft(this);
     this.state = this.walkRight;
 }
Beispiel #23
0
 //Constructor
 public MovingBlock(PyramidPanic game, string blockName, Vector2 location,
                 TileCollision blockCollision, char charItem )
 {
     this.game = game;
     this.texture = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\pushable\" + blockName);
     //this.colText = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\Explorer\CollisionText");
     this.startLocation = location;
     this.Location = location;
     this.state = new MovingBlockIdle(this);
 }
Beispiel #24
0
 // Maak de constructor
 public Beetle(PyramidPanic game, Vector2 position, int speed)
 {
     this.position = position;
     this.game = game;
     this.speed = speed;
     this.texture = this.game.Content.Load<Texture2D>(@"PlayScene\Beetle");
     this.walkDown = new WalkDown(this);
     this.walkUp = new WalkUp(this);
     this.state = this.walkDown;
 }
Beispiel #25
0
 //De constructor
 public Beetle(PyramidPanic game, Vector2 position, float speed)
 {
     this.game = game;
     this.texture = game.Content.Load<Texture2D>(@"PlaySceneAssets\Beetles\Beetle");
     this.collisionTexture = game.Content.Load<Texture2D>(@"PlaySceneAssets\Explorer\collisionTexture");
     this.position = position;
     this.speed = speed;
     this.rectangle = new Rectangle((int)this.position.X + 16, (int)this.position.Y + 16, this.texture.Width/4, this.texture.Height);
     this.collisionRectangle = new Rectangle((int)this.position.X, (int)this.position.Y, this.texture.Width / 4, this.texture.Height);
     this.color = Color.White;
     this.state = new WalkDown(this);
 }
 // Maak de constructor
 public Explorer(PyramidPanic game, Vector2 position, int speed)
 {
     this.position = position;
     this.game = game;
     this.speed = speed;
     this.texture = this.game.Content.Load<Texture2D>(@"PlayScene\Explorer");
     this.idle = new ExplorerIdle(this);
     this.walkRight = new ExplorerWalkRight(this);
     this.walkLeft = new ExplorerWalkLeft(this);
     this.walkDown = new ExplorerWalkDown(this);
     this.state = this.idle;
 }
Beispiel #27
0
 //constructor
 public Scorpion(PyramidPanic game, Vector2 position, float speed)
 {
     this.game = game;
     this.position = position;
     this.texture = game.Content.Load<Texture2D>(@"PlayScene\Badguys\Scorpion");
     this.rectangle = new Rectangle((int)this.position.X + 16, (int)this.position.Y + 16, this.texture.Width / 4, this.texture.Height);
     this.collisionrec = new Rectangle((int)this.position.X, (int)this.position.Y, this.texture.Width / 4, this.texture.Height);
     this.speed = speed;
     this.walkLeft = new WalkLeft(this);
     this.walkRight = new WalkRight(this);
     this.state = this.walkRight;
 }
Beispiel #28
0
 //constructor
 public Beetle(PyramidPanic game, Vector2 position, float speed)
 {
     this.game = game;
     this.position = position;
     this.texture = game.Content.Load<Texture2D>(@"PlayScene\Badguys\Beetle");
     this.rectangle = new Rectangle((int)this.position.X + 16,(int)this.position.Y + 16,this.texture.Width/4,this.texture.Height);
     this.collisionrec = new Rectangle((int)this.position.X, (int)this.position.Y, this.texture.Width / 4, this.texture.Height);
     this.speed = speed;
     this.walkUp = new WalkUp(this);
     this.walkDown = new WalkDown(this);
     this.state = new WalkDown(this);
 }
Beispiel #29
0
 //constructor
 public Explorer(PyramidPanic game, Vector2 position)
 {
     this.game = game;
     this.position = position;
     this.texture = game.Content.Load<Texture2D>(@"explorer/Explorer");
     this.walkUp = new ExplorerWalkUp(this);
     this.walkDown = new ExplorerWalkDown(this);
     this.walkRight = new ExplorerWalkRight(this);
     this.walkLeft = new ExplorerWalkLeft(this);
     this.idle = new ExplorerIdle(this);
     this.state = this.idle;
 }
Beispiel #30
0
 //constructor
 public Explorer(PyramidPanic game,Vector2 position,float speed)
 {
     this.initialize();
     this.game = game;
     this.startpos = position;
     this.texture = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\Player\Explorer");
     this.CollisionText = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\Player\blokje");
     this.position = position;
     this.rectangle = new Rectangle((int)this.position.X + 16, (int)this.position.Y + 16, texture.Width/4, texture.Height);
     this.CollisionRect = new Rectangle((int)this.position.X, (int)this.position.Y, texture.Width/4, texture.Height);
     this.speed = speed;
     this.state = new Idle(this);
 }
Beispiel #31
0
 //Constructor
 public MenuStartScene(PyramidPanic game)
 {
     this.game = game;
     this.Initialize();
 }
Beispiel #32
0
 //constructor
 public LevelEditorScene(PyramidPanic game)
 {
     this.game = game;
 }
Beispiel #33
0
 //constructor
 public HelpScene(PyramidPanic game)
 {
     this.game = game;
 }
Beispiel #34
0
 //constructor
 public Level(PyramidPanic game, int levelIndex)
 {
     this.game      = game;
     this.levelPath = @"Content\PlaySceneAssets\levels\1.txt";
     this.LoadAssets();
 }
Beispiel #35
0
 //constructor
 public LoadScene(PyramidPanic game)
 {
     this.game = game;
 }
Beispiel #36
0
 //constructor
 public QuitScene(PyramidPanic game)
 {
     this.game = game;
 }
Beispiel #37
0
 //Constructor
 public LevelEditorScene(PyramidPanic game)
 {
     this.game = game;
     this.Initialize();
 }
Beispiel #38
0
 //Constructor
 public Panel(PyramidPanic game, Vector2 position)
 {
     this.game     = game;
     this.position = position;
     this.Initialize();
 }
Beispiel #39
0
 //constructor
 public PlayScene(PyramidPanic game)
 {
     this.game = game;
     this.Initialize();
 }
Beispiel #40
0
 //constructor
 public ScoreScene(PyramidPanic game)
 {
     this.game = game;
 }