I am having trouble using the right click of the mouse... Whenever I use the method mouse.getButton() == 3, it gives me an error:
java.lang.NullPointerException
at Steve.checkKeys(Steve.java:27)
at Steve.act(Steve.java:20)
at greenfoot.core.Simulation.actActor(Simulation.java:507)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:470)
at greenfoot.core.Simulation.runContent(Simulation.java:204)
at greenfoot.core.Simulation.run(Simulation.java:194)
and whenever I try to add a object after another one got removedit doesn't appear. I am very confused right now...... Please and Thank you for your help.
(getWorld().removeObject(this); getWorld().addObject( new Ground(), 250,10);