Hello again. I'm afraid I have another question. I have this code to create a random actor in a certain position. The code below is only OK for one actor with the name B2 but I'm going to expand it if I can get the logic working. I have an array called "classes" which contains the names of all my actors.
When I compile I'm getting the message "Incompatible Types" and the line createClasses = newB2 is highlighted. Any suggestions? Thanks in advance for any help. I'll try not to bug you all too much after this!
for (int i = 0; i < classes.length - 1; i++) { int randomNumber = Greenfoot.getRandomNumber(classes.length - 1); B2 newB2 = new B2(); createClasses[i] = newB2; addObject (createClasses[i], 200, 140); }