Hey all,
New to Cocos2d programming, please excuse the simple question. I am trying to add a HUD overlay to my game, but am finding it tricky since my camera follows the vehicle. Since the camera is moving, the HUD must move every frame to look static. Here is some code I am having a problem with:
-(void)update{
float* x;
float* y;
float* z;
[camera eyeX:x eyeY:y eyeZ:z];
[self setPosition:cpv(*x-100,*y-100)];
}
This is called during every frame of the game, however the call to get the camera coordinates gives me a EXC_BAD_ACCESS for the z variable. Can anyone help me out? Either by giving me some guidance on what to do for a HUD (can't seem to find any tutorials) or how to fix this specific code?