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

2012/6/21

Extends, extends, extends... Change variables as you go?

darkmist255 darkmist255

2012/6/21

#
For some background, this is how the classes start off public class Tile extends Actor { public boolean passable = true; } public class TILE_rock extends Tile { public boolean passable = false; } When I inspect an object TILE_rock, I see "public boolean passable = false" and also a "public (hidden) boolean passable = true" Will this hidden boolean throw things off or does it have no effect? I'm trying to determine the source of a bug and I don't know if this is relevant.
kiarocks kiarocks

2012/6/21

#
the hidden one is most likely the one above (in tile class). So, to access it you probably call super.passable, but for your case it seems to be irrelevant. note: this is off the top of my head and involves guessing.
You need to login to post a reply.