我在做我的游戏, 我有一个如此艰难的时间 环绕着我的头 围绕一个概念,也许你可以 帮我澄清它。
So in the bullet class i create a bullet object at point 0,0 which is fine then when i really create it from the main game i create it at point
平面位置.x, 0
将它置于玩家所在的 X 轴上,而 Y 轴上为屏幕底部的 Y 0 轴上
My issue is lets say i want to create the bullet at the top of the gun for example. not at the base of the screen. so i would write thePlayer.position.x,60; it would start it at the top of the gun but there would be a offset of 60 till it hits the target... i did come up with a solution but i don t like it. I think there has to be a better answer..
my answer is: make a var call bulletOffet=any number lets say 60 then create the bullet at thePlayer.position.x, 0+bulletOffSet
现在,当我检查我 子弹和目标
for (Bullet *someBullet in self.children) { if ([someBullet isKindOfClass:[Bullet class]]) { CGPoint bulletPoint = CGPointMake(someBullet.position.x, someBullet.bulletSprite.position.y+bulletOffSet);
this does work but again there has to be a better solution let me know what i m missing thank you