昨天调整了annimatedAnnotation的大小,并且制作了一个爆炸效果,遇到的问题是,userLocation自己的图片的大小调节,今天首先想把这个问题解决了。
高德地图的annimatedAnotation动画的显示
(void)updateImageView
{
AnimatedAnnotation *animatedAnnotation = (AnimatedAnnotation *)self.annotation;
if ([self.imageView isAnimating])
{
[self.imageView stopAnimating];
}
self.imageView.animationImages = animatedAnnotation.animatedImages;
self.imageView.animationDuration = kTimeInterval * [animatedAnnotation.animatedImages count];
self.imageView.animationRepeatCount = 0;
[self.imageView startAnimating];
}`
这个函数是封装在了AnimatedAnnotationView里边,我想达到的效果是,可以加载动画帧的精灵图,配置大小,动画播放次数,所有的这些配置我都封装在了animatedAnnotation中,这样,annotationView可以读取annotation中的文件进行动画显示
2016.5.2
*ipad进入游戏,初始化地图crash,只在ipad上重现,发现问题在:
if ([info objectForKey:@"DisplayName"] == UserName) {
continue;
}
这一段,在ipad上,即使字符串相同,也不会走进分支。。。
目前还没有搞清为什么,现在的解决是用:
if ([[info objectForKey:@"DisplayName"] isEqualToString:UserName]) {
continue;
}
问题没有发生
不过这个问题,和后来的双机调试,暴露了一个问题,就是在初始化画地图的时候,服务器发过来的玩家信息是没有经纬度的,目前的临时解决是特殊判断如果经纬度是null,则赋值为0,之后再在playerUpdate上更新,之后一个比较好的解决方式应该是加入游戏后,引导玩家进入游戏区域,进入等待区,这个时候,开始发送玩家位置,服务器判断所有玩家都有发送位置后,开始游戏,不过目前来说问题不大
*加入玩家在游戏开始后无法跳转进入游戏页面,问题原因是onGameStart callback同事用于了点击start button和广播,但是两个callback的判断是不一样的,解决方式是点击button的callback中什么都不做(以后可以做一些状态判断)host和player都等待广播的消息后,启动游戏