Hi,
I've been having trouble using the 'Greenfoot.mouseClicked(XXX)' command.
Basically, within a world called 'PlayGame', I have defined a variable:
'Player' is the name of the Actor from where I am defining the variable (not sure if this sentence makes sense but I think you would catch the gist of what I mean)
I have placed the variable somewhere in my 'PlayGame' world, like so:
Now, I am trying to check whether someone has clicked on 'thePlayer' from the 'PlayGame' world. This is the code that I tried inside the contructor:
This code does not seem to be working. When I click on 'thePlayer', what I want to happen does not happen. Am I doing something wrong?
I would really appreciate any help.
Thanks
Player thePlayer = new Player();
addObject(thePlayer,4,5);
if(Greenfoot.mouseClicked(thePlayer)) { //Action goes here }