Closed mukesh14149 closed 8 years ago
I guess, the problem is that the obstacles layer of Gotham is a background and not a obstacle layer.
Someone can comment and solve it :)
Yeah sure!
I think the obstacles layer of gotham is correct i.e Gotham_obstacles, but still this not working, when i change (createObstacles("Gotham_obstacles"); to createObstacles("cactus"); ) in method gothamShow() in background.js file it works fine but with Gotham_obstacles it doesn't work, can you help me little to resolve it @niccokunzmann
Okay, I think the problem might be that only g
objects (groups) are allowed as obstacles. We discussed this would need treatment. The problem could be here. Obstacle collision still needs work but we have a basic version running.
You can try around, what would be best.
In all cases, we should open a new issue that improves obstacle collision and adds all the concerns we could have.
Maybe easy was misjudged. I should not tag issues with difficulties if I do not know them, maybe.
g objects(groups) is used for every layer like background, SunAndMoon, sky, Gotham_obstacle, cactus etc so i tried replacing different layers for createObstacles(layer) and found only cactus layer react as obstacle.
I am referring to
var list = layerNamed(layer).getElementsByTagName("g");
especially to getElementsByTagName
. This line says that only group objects can be obstacles. In case the obstacles in the gotham theme are not grouped, they can not be hit. Are they grouped?
I think they are grouped.
This is only one grouped. Look further.... The creator used clones to keep the file size down. There are several objects: the one g object and the use objects, the clones.
@niccokunzmann We can close this issue.
Yes, #115 closes this.
While playing with background Gotham, there is no obstacle come in path, it is just going and going. @niccokunzmann