Hello Greenfoot community,
I'm new to Greenfoot and have done some of the tutorials, and have tried to make something on my own. It is something I'm making so I know how to make a tic-tac-toe game later on. I want to be able to click a house that is invisible to begin with and make it visible for the rest of the run time. However, it only turns What is wrong with my code so far?
Thank you.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class House here. * * @author (your name) * @version (a version number or a date) */ public class House extends Actor { /** * Act - do whatever the House wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { getImage().setTransparency(0); if (Greenfoot.mouseClicked(this)) { getImage().setTransparency(100); } } }