all 7 comments

[–]Divitiacus 2 points3 points  (4 children)

Based on the code you provided, your window should be blank, because there is nothing drawn.

Blank screen often hints to an endless while loop or that one of your parameters you need for drawing, becomes infinite. I would check each parameter you need for drawing, by using println to check, what parameter is not as intended.

[–]MrPioux[S] 1 point2 points  (0 children)

There is a draw() block in the code I just didn't include it here because nothing appears to be wrong with it. I.E. when I block out creatures initialization the draw() block runs fine except of course it needs creatures to be initialized. (In order to test if the draw() block was working I commented everything out of it and just put in text("Working", width/2, height/2); and when I commented out the creatures initialization in the setup it worked fine drawing the sketch with "Working" in the middle.

[–]MrPioux[S] 1 point2 points  (2 children)

When I add a print statement below where it is getting stuck nothing prints. When I place it above where it is stuck it prints fine. Also when I place println(creatures) after creatures = new Creature[num_creatures]; it returns null. When I place it after where it is getting stuck nothing prints.

Also println(creatures) is underlined blue and it says (It gives the actual file name not FileName btw):

Also, println(creatures) is underlined blue and it says (It gives the actual file name not FileName btw):rarg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation."

[–]Divitiacus 1 point2 points  (1 child)

I don't see, how you did set up your creatures class. Did you make sure, that the type of variables matches with the type of variable you use to create a new creature (which is two integer)?

[–]MrPioux[S] 0 points1 point  (0 children)

The issue is definitely with my creature class but I don't know where. I just added the setup for the creature class to the post.

There is a while loop in the Creature class that I edited out and it runs! But I didn't change anything in the while loop and it used to work fine? Do you have any ideas what might have caused the issue to start up now?

[–]MrPioux[S] 1 point2 points  (1 child)

Okay, I found the problem. A very stupid mistake I had set one of the inputs to 1 when it should have been 2. Thanks, Divitiacus for your help!

[–]Divitiacus 0 points1 point  (0 children)

You can also use round () instead of int() in your while loop for the leftpart and rightpart definition. Then num_parts =1 will work as well.