Well first of all, to start, I think something is screwed up with my sdk. Everytime I run my program and I have some sort of warning , or error, it says I have double that amount of actual errors that I have. Whatever.
So to my app, I get a couple of errors with these parts of code:
Code:
for (int x=0; x < [bulletArray count]; x++) {
UIImageView *Bullet = [bulletArray objectAtIndex:x];
NSInteger sliderAngleValue = [bulletValuesArray objectAtIndex:x];
Error:Initialization makes integer from pointer without a cast
//CGPoint bulletPos = CGPointMake(0, 0);
if(sliderAngleValue<0){
CGPoint bulletPos = CGPointMake(sliderAngleValue*10,-5-(sliderAngleValue*10));
Bullet.center = CGPointMake(Bullet.center.x+bulletPos.x, Bullet.center.y+bulletPos.y);
Error: Local declaration of bulletPos hides instance variable.
} else {
CGPoint bulletPos = CGPointMake(sliderAngleValue*10,-5+(sliderAngleValue*10));
Bullet.center = CGPointMake(Bullet.center.x+bulletPos.x, Bullet.center.y+bulletPos.y);
Error: Local declaration of bulletPos hides instance variable.
}
}
I might have imbalanced parenthesis, but thats just a copy thing. so basically I created a shooter game. When the user fires a bullet, it is stored in an array called bulletArray, and I use a slider that the user can slide to rotate the turret. At the same time I store the value of the slider into an array, bulletValuesArray. I retrieve these two things above, and then in the if statements I just use the formula to move the bullet wherever the user has fired it by running through all of the bullets and values, but I have a couple problems above. These are just errors but my program is crashing with them. Thanks in advance!