Hello, I am learning to program with Java, and I am making a tic tac toe game.
I have a selector you can move around with the arrowkeys on the keyboard. That works, but now I would like it to spawn a cross or circle when you press enter. The addObject gives an error when I try to use it . Does anyone know what I'm doing wrong here?
This piece of code is written in the Selector class, which extends Actors. I have a cross class and naught class too, both empty.
if(Greenfoot.isKeyDown("enter")) { cross cross1 = new cross(); int e = getX(); int f = getY(); MyWorld.addObject(new cross(),e,f); }