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

2012/11/26

cannot find symbol - method getColor()

JES201027 JES201027

2012/11/26

#
That is the error I am getting when I run my code, I am programming in gridworld. The part of the code where I am getting the error is when i do: grid.get(mateLoc.get(0)).getColor() mateLoc is an ArrayList that stores the location of an actor grid is a variable made of Grid that store getGrid() I am trying to get the color of the actor in mateLoc. Please Help
danpost danpost

2012/11/27

#
In what class is the 'getColor' method located?
JES201027 JES201027

2012/11/27

#
It is a method that is built into the actor class. This code is located in that class
danpost danpost

2012/11/27

#
Is this something that is specific to GridWorld? Or, are you saying that you wrote the code that uses the method in the actor class? (which is not what I was asking) The only 'getColor' method I am aware of is the one in the GreenfootImage class; and therefore needs a GreenfootImage object to be called on. (this is what I was asking)
JES201027 JES201027

2012/11/27

#
Never mind I got it, thanks though!
You need to login to post a reply.