Example #1
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();
 }
 public static void DrawText(DrawableTextObject dto)
 {
     if (dto.Visible)
         spriteBatch.DrawString(dto.Font, dto.Text.ToString(), dto.Position, dto.Color);
 }
Example #3
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();
        }
Example #4
0
 public TextButton(string texturePath, Rectangle rectangle)
     : base(texturePath, rectangle)
 {
     Text = new DrawableTextObject();
     this.TextObjects = new List<DrawableTextObject>();
 }