how do i make it so that when the mouse clicks on a area in the world a bomb will be placed, i mean put in by a player not when im adding actors to the world


// add this variables as globals; private int x = 0; private int y = 0; public void act() { ... MouseInfo mouse = Greenfoot.getMouseInfo(); if (mouse != null) { x = mouse.getX(); y = mouse.getY(); if (Greenfoot.mouseClicked(null)) { if (x > minX && x < maxX && y > minY && y < maxY) {//minX, maxX, ... should be the coordinates for the field in which you want the actor to add a bomb; getWorld().addObject(new Bomb(), x, y);//adds the Bomb at the coordinates of the mouse. If you want the bomb on other coordinates chage x and y; } } } ... }