Nitish
Nitish

Reputation: 14113

Move background - Cocos2D

I am trying to develop a car game in which opponents are coming from opposite direction. And we have to avoid collision. For this I want to move my background as the opponent cars approach the good car. What should I do to move the background?

Regards,
Stone

Upvotes: 0

Views: 697

Answers (1)

al3el
al3el

Reputation: 28

1.- You need to create a map: example with program "Tiled".
2.- Add to resources
3.- Insert code:

CCTMXTiledMap * tmxMap = [CCTMXTiledMap tiledMapWithGMXFile:@"Map.tmx"];
[tmxMap runAction:[CCMoveBy actionWithDuration:1.0 position:ccp(0,-400)];

Upvotes: 1

Related Questions