Hey guys, as u saw I the title I got the following Problem: Greenfoot doesn't recognzies or reacts to a click on the Object. I checked it in the debugger, to be sure that the click recognition is running, but it doesn't helps at all.
Thanks for your help.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) java.util.ArrayList; import java.util.*; /** * Write a description of class Game here. * * @author (your name) * @version (a version number or a date) */ public class Game extends World { //Color codes: 0=Black;1=Blue;2=Brown;3=Green;4=Grey;5=Red;6=White;7=Yellow //Declaring Variables //I left some further declarations out of here beecause it would be too much //Buttons PinTap black = new PinTap(); PinTap blue = new PinTap(); PinTap brown = new PinTap(); PinTap green = new PinTap(); PinTap grey = new PinTap(); PinTap red = new PinTap(); PinTap white = new PinTap(); PinTap yellow = new PinTap(); public Game() { super(1280, 720, 1); //Buttons addObject(black,50,(90-45)); addObject(blue,50,(180-45)); addObject(brown,50,(270-45)); addObject(green,50,(360-45)); addObject(grey,50,(450-45)); addObject(red,50,(540-45)); addObject(white,50,(630-45)); addObject(yellow,50,(720-45)); addObject(line,100,360); } public void act() { clearAll(); run = true; generateCode(); while(run) { if(Greenfoot.mouseClicked(black)){tappedBlack++;addToList();} else if(Greenfoot.mouseClicked(blue)){tappedBlue++;addToList();} else if(Greenfoot.mouseClicked(brown)){tappedBrown++;addToList();} else if(Greenfoot.mouseClicked(green)){tappedGreen++;addToList();} else if(Greenfoot.mouseClicked(grey)){tappedGrey++;addToList();} else if(Greenfoot.mouseClicked(red)){tappedRed++;addToList();} else if(Greenfoot.mouseClicked(white)){tappedWhite++;addToList();} else if(Greenfoot.mouseClicked(yellow)){tappedYellow++;addToList();} } //if(getCurrentRound() == 13){}else{} }