Exemplo n.º 1
0
        public void reset()
        {
            for (int i = 0; i < obstacles.Length; i++)
            {
                float X = rand.Next(minX, maxX);
                float Y = rand.Next(minY, maxY);

                obstacles[i] = new Stalagmite((float)X, (float)Y, orgSpeed, gameManager);
            }
            counter = 0;
        }
Exemplo n.º 2
0
        public ObstacleSpawner(int totalNumObs, int maxX, int minX, int maxY, int minY, int maxTime, int minTime, int speed, GameManager gameManager)
        {
            this.maxTime     = maxTime;
            this.minTime     = minTime;
            this.maxX        = maxX;
            this.minX        = minX;
            this.minY        = minY;
            this.maxY        = maxY;
            this.speed       = speed;
            this.gameManager = gameManager;
            obstacles        = new Stalagmite[totalNumObs];
            rand             = new Random();
            spawnTimer       = 0;
            deltaTime        = rand.Next(minTime, maxTime);
            for (int i = 0; i < obstacles.Length; i++)
            {
                float X = rand.Next(minX, maxX);
                float Y = rand.Next(minY, maxY);

                obstacles[i] = new Stalagmite((float)X, (float)Y, speed, gameManager);
            }
        }