示例#1
0
    // public void RandomBot(Window gameWindow)
    // {
    //     _gameWindow = gameWindow;
    //     Player player1 = new Player(gameWindow);
    // }
    public void Update()
    {
        int count = _robots.Count;

        for (int i = 20; i > _robots.Count; i--)
        {
            Boxy testBoxy = new Boxy(_gameWindow, _player);
            _robots.Add(testBoxy);
            System.Console.WriteLine("BOXY");

            for (int j = 0; j == _robots.Count % 2; j += 2)
            {
                Roundy testRoundy = new Roundy(_gameWindow, _player);
                _robots.Add(testRoundy);
                System.Console.WriteLine("ROUNDY");
            }
        }

        foreach (Robot a in _robots)
        {
            a.Update();
            a.isOffScreen(_gameWindow);
        }

        CheckCollisions();
    }
示例#2
0
    //return a new robot object
    public Robot RandomRobot()
    {
        Robot _RandomRobotOne   = new Boxy(_GameWindow, _Player);
        Robot _RandomRobotTwo   = new Roundy(_GameWindow, _Player);
        Robot _RandomRobotThree = new Custom(_GameWindow, _Player);

        double randomNumber = SplashKit.Rnd(900);

        if (randomNumber < 300)
        {
            return(_RandomRobotOne);
        }
        else if (randomNumber > 300 & randomNumber < 600)
        {
            return(_RandomRobotTwo);
        }
        else
        {
            return(_RandomRobotThree);
        }
    }
示例#3
0
    public Robot RandomRobot()
    {
        Robot _TestRobot;

        if (SplashKit.Rnd() < 0.5)
        {
            _TestRobot = new Boxy(_GameWindow, _Player);
        }
        else
        {
            if (SplashKit.Rnd() < 0.5)
            {
                _TestRobot = new Roundy(_GameWindow, _Player);
            }
            else
            {
                _TestRobot = new Octopus(_GameWindow, _Player);
            }
        }
        return(_TestRobot);
    }