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

2012/1/7

Cannot find symbol - variable direction ?

TopInPut TopInPut

2012/1/7

#
if([u]direction[/u].equals("west||east||north||south"))
I need that line in my code, but then it says Cannot find symbol - varable direction . What shall i do? Shall i create a variable "direction" and say getX() and getY() ?
TopInPut TopInPut

2012/1/7

#
Upps.;) Heres the Code again.=)
if(direction.equals("west"))
davmac davmac

2012/1/7

#
If you're trying to check the direction that your actor is facing, use getRotation() and compare it to various angles, not to strings. Eg instead of if (direction.equals("west")) { Use if (getRotation() == 180) {
TopInPut TopInPut

2012/1/7

#
Thx.;) That works.:)
You need to login to post a reply.