Esempio n. 1
0
 public Player(float xmin, float xmax, Color c, int playerNum)
 {
     rightHanded = true;
     visible = true;
     color = c;
     id = playerNum;
     hovering = false;
     hoverTime = new Timer();
     pc = new ProgressCircle();
 }
        public CalibrationScreen()
        {
            countdown = 5;
            timer = new Timer();

            int screenWidth = Program.game.screenWidth;
            int screenHeight = Program.game.screenHeight;
            window = new Rectangle(0, 0, screenWidth, screenHeight);

            int buttonWidth = 170;
            int buttonHeight = 92;
            int y = window.Bottom - window.Height / 2;
            int menuX = window.Left + window.Width / 2 - buttonWidth / 2;
            startButton = new Button(new Point(menuX, y), buttonWidth, buttonHeight, "save", "Buttons/save");
            y = window.Bottom - window.Height / 3;
            menuButton = new Button(new Point(menuX, y), buttonWidth, buttonHeight, "settings", "Buttons/settings");
            buttons = new List<Button>();
            buttons.Add(menuButton);
        }
Esempio n. 3
0
        public Maze(int _level, bool _singlePlayer)
        {
            goalColor = Color.Red;
            wallColor = Color.Black;
            timer = new Timer();
            wallHits = 0;
            prevHit = new bool[2] { false, false };
            level = _level;
            singlePlayer = _singlePlayer;

            balls = new List<Ball>();
            walls = new List<Rectangle>();
            goal = new Rectangle();
            switches = new List<DoorSwitch>();

            string mazeFile = "Mazes/" + level + ".maze";
            readFile(mazeFile);

            pauseButton = new Button(new Point(Program.game.screenWidth - 170, 30), 136, 72, "Pause", "Buttons/pause");
        }
Esempio n. 4
0
        public Maze()
        {
            curColorIndex = 0;
            colorArray = new Color[] { Color.Orange, Color.Lime, Color.Pink, Color.Crimson, Color.White, Color.Orchid, Color.SteelBlue, Color.Gray };
            goalColor = Color.Red;
            if (!Program.game.hiddenMode)
                wallColor = Color.Black;
            else
                wallColor = Color.Transparent;
            timer = new Timer();
            wallHits = 0;
            prevHit = new bool[2] { false, false };

            balls = new List<Ball>();
            walls = new List<Rectangle>();
            goal = new Rectangle();
            switches = new List<DoorSwitch>();

            pauseButton = new Button(new Point(Program.game.screenWidth - 170, 30), 136, 72, "Pause", "Buttons/pause");

            string mazeFile;
            if (!Program.game.customLevel)
            {
                if (singlePlayer = Program.game.singlePlayer)
                    mazeFile = "Mazes/" + (Program.game.level + 12) + ".maze";
                else
                    mazeFile = "Mazes/" + Program.game.level + ".maze";
                readFile(mazeFile);
            }
            else
            {
                mazeFile = "Mazes/custom" + Program.game.level + ".maze";
                readFile(mazeFile);
                singlePlayer = balls.Count == 1;
            }
        }