Original Post
I did a search and couldn't find any other posts. I'm using the following code to get a random number to pick the next block type, however everytime it gets to the 6th block, the block stays at the bottom of the screen and the random generator just goes nuts displaying all blocks in rapid succession. If i change rand.Next(0,7) i get the same results. If i lower rand.Next(4) then it goes nuts on the 3rd block. Is the random command bugged or am i missing something perhaps. Any help appreciated. I've commented out the areas where i've tried to run random and eventually moved it to a global variable. Random rand = new Random(); private int Rdm() { //Random rand = new Random(); int nextShapeNo = rand.Next(7); return nextShapeNo; } private void CurrentShape()//selects a shape to display on the screen. Will update to reflect next shape { //then current shape will be retrieved from the next shape variable. //Random rand = new Random(); //int currentShapeNo = rand.Next(0,6); Rdm(); int currentShapeNo = Rdm(); switch (currentShapeNo) { case 0: currentShape = sevenBlock; break; case 1: currentShape = rBlock; break; case 2: currentShape = tBlock; break; case 3: currentShape = sBlock; break; case 4: currentShape = zBlock; break; case 5: currentShape = lineBlock; break; case 6: currentShape = squareBlock; break; } blockSpeed = new Vector2(100.0f, 100.0f); }