Exemplo n.º 1
0
 public BaseObject(string path, Rectangle rectangle)
     : base(path, rectangle)
 {
     coordinates = new Vector2(Rectangle.X, Rectangle.Y);
     TimeKeeper = new TimeKeeper();
     hasCollidedWithObject = false;
 }
Exemplo n.º 2
0
 public BaseObject(Texture2D texture, Rectangle rectangle)
     : base(texture, rectangle)
 {
     coordinates = new Vector2(Rectangle.X, Rectangle.Y);
     TimeKeeper = new TimeKeeper();
     hasCollidedWithObject = false;
 }
Exemplo n.º 3
0
 public ClassicMaze(int displayWidth, int displayHeight, IMazeGameHost host)
     : base(displayWidth, displayHeight, new GuestProfile())
 {
     timeScoreIncrement = 1.67;
     maxTimeScore = 1000;
     this.gameHost = host;
     timeToCompleteMaze = new TimeKeeper();
     itemManager = new ItemManager();
     camCol = null;
     camRow = null;
 }
Exemplo n.º 4
0
 public ClassicMaze(int displayWidth, int displayHeight, IMazeGameHost host,
     UserProfile profile, GameDifficulty difficulty = GameDifficulty.Normal)
     : base(displayWidth, displayHeight, profile, difficulty)
 {
     timeScoreIncrement = 1.67;
     maxTimeScore = 1000;
     this.gameHost = host;
     timeToCompleteMaze = new TimeKeeper();
     itemManager = new ItemManager();
     camRow = null;
     camCol = null;
 }
Exemplo n.º 5
0
 public override void Dispose()
 {
     this.entity = null;
     this.checkPoint = null;
     this.dtoGameTime = null;
     this.timeToCompleteMaze = null;
     this.mapExamMenu = null;
     this.pauseMenu = null;
     this.gameOverMenu = null;
     this.gameOverData = null;
     this.TotalGameTime = null;
     this.UserProfie = null;
     this.Walls = null;
     this.Weapons = null;
     base.Dispose();
 }
Exemplo n.º 6
0
 private void UpDateTimeKeeper(TimeSpan time, TimeKeeper tk)
 {
     tk.AdjustTime(time);
     tk.AdjustTimeSpan(time);
 }
Exemplo n.º 7
0
        public override void LoadGame(MenuSelections menuSelections)
        {
            this.Gamestate = GameState.Loading;
            string mapPath = "XmlData/Maps/" + menuSelections.MapName;
            LevelMapXMLData mapData = Load.LoadMapData(mapPath);
            map = new MazeMap(mapData);

            entity = new Ball("Graphics/ball", new Rectangle(110, 350, 40, 40), 5);
            checkPoint = new CheckPoint("Graphics/checkpoint", Rectangle.Empty);
            checkPoint.Color = Color.White;
            checkPoint.Visible = true;
            PositionCheckPoint();

            TotalGameTime = new TimeKeeper();
            dtoGameTime = new DrawableTextObject()
            {
                Color = Color.BlueViolet,
                Font = Load.LoadFont("Fonts/font"),
                Position = new Vector2(Width/3 + 50, 0),
                Visible = true,
            };

            TileMap tMap = map as TileMap;
            camera = new AdjustableTileCamera(ref tMap, Width, Height);
            camController = camera.GetController();
            camera.MonitorRectangle(entity);
            camera.LeftScrollPoint = 199;
            camera.RightScrollPoint = camera.Width - 199;
            camera.VerticalDisposition = entity.Height * 2;
            camera.TopScrollPoint = 199;
            camera.BottomScrollPoint = camera.Height - 150;
            camera.HorizontalDisposition = entity.Width * 2;
            camera.FixedHorizontalPoints = new Vector2(199, camera.Width - 199);
            camera.FixedVerticalPoints = new Vector2(199, camera.Height - 149);
            camera.SetEdgeCusionSpacing(100);
            camera.UseEdgeCusions = true;
            camera.ScrollTime = 250;
            TopBorder = LeftBorder = 0;
            RightBorder = Width;
            BottomBorder = Height;

            countDownTimer = 3;
            countDown = new DrawableTextObject()
            {
                Font = Load.LoadFont("Fonts/countDownFont"),
                Color = Color.BlueViolet,
                Position = new Vector2(325, 100),
                Visible = true,
                Text = new StringBuilder(countDownTimer.ToString())
            };

            Walls = new List<Wall>();
            CreateWalls();

            StartGame();
        }