im trying to modify this code using a "for" loop to create 'numPlayers' players. That is, if the user types in 3 for 'numPlayers', then it should loop 3 times and create 3 players.
private void readPlayers()
{
int numPlayers = askForInt("How many players will play?");
String name = askForString("W hat is player 1's name?");
Player player = new Player(name);
player.enterWor ld(world);
}
any suggestions ??? thankyou
private void readPlayers()
{
int numPlayers = askForInt("How many players will play?");
String name = askForString("W hat is player 1's name?");
Player player = new Player(name);
player.enterWor ld(world);
}
any suggestions ??? thankyou
Comment