Skip to content

Unable to make popSize less then 2 #6

Description

@Robotkubo

So I get that the number of the colored balls are equal to the number of player balls, and I don't like the way that looks so I'm just trying to change the popSize to be equal to 1 so that it works better but for some reason and i'm not sure if I'm just dumb but when I set it to 1 the screen will not show any balls at all. the lowest has to be 2 and I'm not 100% why, if I'm just missing something please tell me I'm dumb

Population pop;//the population of pool players
Box2DProcessing[] box2d;//each player needs an individual world so this array stores them
int popSize = 1;//the amount of players tested at once
table[] tables;//each player also needs a table
int speed = 60;//frameRate

boolean showSingle = false;//whether only one player needs to be shown because they are all the same
boolean saveFrames = true;//true if it the first gen after increasing the number of shots so it saves the full game not just the last shot
//------------------------------------------------------------------------------------------------------------------------------------------------------------------
void setup() {
size(400, 800);
frameRate(speed);//set the initial frame rate

//initialise worlds and tables
box2d = new Box2DProcessing[popSize];
tables = new table[popSize];

for (int i = 0; i< box2d.length; i++) {//create each of the worlds and add a table to them
box2d[i] = new Box2DProcessing(this);
box2d[i].createWorld();
box2d[i].setGravity(0, 0);//no gravity
tables[i] = new table(box2d[i]);
}
pop = new Population(popSize);//create the population
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions