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

2015/4/20

When I put in a boolean it asks for an Actor but when I try and Actor it asks for boolean

Hombow Hombow

2015/4/20

#
This is the code
if(leftWallCheck = null)
and comes up with the error: found greenfoot.Actor expected boolean but if I try
if(leftWallCheck = false)
and comes up with the error: found boolean expected greenfoot.Actor
Super_Hippo Super_Hippo

2015/4/20

#
What is 'leftWallCheck'? Is it a boolean? If yes, change the '=' to '==' and use true or false. For your info:
if (leftWallCheck)
//is the same as
if (leftWallCheck == true)

//and
if (!leftWallCheck)
//is the same as
if (leftWallCheck == false)
Hombow Hombow

2015/4/20

#
its meant to be an actor but I will try "=="
Hombow Hombow

2015/4/20

#
it says they are "uncomparable types: greeenfoot.Actor and boolean"
Super_Hippo Super_Hippo

2015/4/20

#
Did you use 'null'?
Hombow Hombow

2015/4/20

#
yes and I tried it with a specific actor but I'm not sure if i got the code right for that part
You need to login to post a reply.