1

I am developing an endless horizontal scrolling iPhone-game using cocos2d and box2d.

My hero has to jump over obstacles (kinematic box2d bodys) which are added on the same layer as my hero-sprite.

My problem is the different speed of the parallaxe background and the obstacles. It dosent look like they are connected. I cant find an solution to solve this problem. I have tried to find the same speed ... but no luck. The bet would be to add the obstacles as child to the parallaxe layer but it dosent work.

Thank you

sultan (sorry for the bad english)

Thomas G.
  • 1,003
  • 12
  • 27

1 Answers1

0

Create one separate CCLayer class for moving object with box2D and add that layer to your parallaxlayer.

Here is one of my cocos2D, parallax based game: SUBVERSION SOURCE LINK

Guru
  • 21,652
  • 10
  • 63
  • 102
  • Thanks for your reply! I already had an extra layer for the box2d objects. The objectLayer is added to the parallaxLayer and this layer to my gamePlay-scene. I have to set the velocity of the parallaxLayer and also for the bodies (obstacles). But it´s look really unreal because of not exactly the same speed? – Thomas G. Aug 17 '12 at 10:54