iphone - Move Background CCSprite repeatedly like a moving road -
i'm new cocos2d , have image 640 x 1136 pixel , set background sprite statically. want move sprite, continuously moving background in upward direction. set code below in init
method. here code :
background = [ccsprite spritewithfile:@"bgimagevertical.png"]; background.scalex = 1; background.scaley = 1; nslog(@"size x :: %f && y :: %f",size.width,size.height); background.position = ccp(size.width/2,size.height/2); [self addchild:background];
lot of parallax scrolling tutorials available on internet. try searching right term. here 1 you: http://www.learn-cocos2d.com/2012/12/ways-scrolling-cocos2d-explained/
Comments
Post a Comment