This code is slowing my game down because it is so big... is there an easier way to code this?
public void spawnTank() { firstRand = (Greenfoot.getRandomNumber(600)); secondRand = (Greenfoot.getRandomNumber(4)); northAndSouth = (Greenfoot.getRandomNumber(640)); eastAndWest = (Greenfoot.getRandomNumber(540)); tank tank = new tank(); if(firstRand == 0) { if(secondRand == 0) { //spawn west addObject(tank, 5, northAndSouth + 5); } if(secondRand == 1) { //spawn south addObject(tank, northAndSouth + 5, 645); } if(secondRand == 2) { //spawn east addObject(tank, 645, northAndSouth + 5); } if(secondRand == 3) { //spawn west addObject(tank, northAndSouth + 5, 5); } } }