移动背景 - Cocos2D [英] Move background - Cocos2D

查看:106
本文介绍了移动背景 - 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?

回答,

Stone

Regards,
Stone

推荐答案

1.-您需要创建一个地图:示例程序Tiled。

2.-添加到资源royalty
3.-插入代码:

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)];

这篇关于移动背景 - Cocos2D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆