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

2018/10/30

fat cat project - need help writing if statement

Toodumbtocode Toodumbtocode

2018/10/30

#
I'm very new to greenfoot but i don't know whats wrong with my if statement!! please help
if(Cat.isTired)
    {
        
        
    }    
danpost danpost

2018/10/30

#
Toodumbtocode wrote...
I'm very new to greenfoot but i don't know whats wrong with my if statement!! please help << Code Omitted >>
A class can create multiple same-type object and each will have their own state. That is to say, which Cat instance are you trying to determine is tired? Cat, being the name of a class, does not answer this. You need to get the state of an object of the class, not the class itself.
You need to login to post a reply.