fossasia / flappy-svg

Flappy Bird in SVG. Play it at http://fossasia.github.io/flappy-svg/
Other
1.61k stars 157 forks source link

No hit point in background Gotham. #70

Closed mukesh14149 closed 8 years ago

mukesh14149 commented 8 years ago

While playing with background Gotham, there is no obstacle come in path, it is just going and going. @niccokunzmann

niccokunzmann commented 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 :)

mukesh14149 commented 8 years ago

Yeah sure!

mukesh14149 commented 8 years ago

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

niccokunzmann commented 8 years ago

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.

mukesh14149 commented 8 years ago

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.

niccokunzmann commented 8 years ago

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?

mukesh14149 commented 8 years ago

I think they are grouped. screenshot from 2016-02-08 01 47 26

niccokunzmann commented 8 years ago

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.

hkveeranki commented 8 years ago

@niccokunzmann We can close this issue.

niccokunzmann commented 8 years ago

Yes, #115 closes this.