This site requires JavaScript, please enable it in your browser!
Greenfoot back
SchoolStuff
SchoolStuff wrote ...

2017/6/14

Mouse press add score without background

SchoolStuff SchoolStuff

2017/6/14

#
So we are making a game, kind of like piano tiles. We made a counter and if you click on the block it adds 1 point, but if you click on the background the same thing happens. The code we used is: This is in class counter. public void act() { setImage(new GreenfootImage("Score : " + score, 24, Color.BLACK, Color.WHITE)); if(Greenfoot.mouseClicked(null)){ addScore(); } } How can we avoid this problem.
Venbha Venbha

2017/6/14

#
I dont know..
SchoolStuff wrote...
So we are making a game, kind of like piano tiles. We made a counter and if you click on the block it adds 1 point, but if you click on the background the same thing happens. The code we used is: This is in class counter. public void act() { setImage(new GreenfootImage("Score : " + score, 24, Color.BLACK, Color.WHITE)); if(Greenfoot.mouseClicked(null)){ addScore(); } } How can we avoid this problem.
maybe i kinda making the same game.. See mine here ---->HERE for the code <-----
You need to login to post a reply.