my game is like battle city.
I made one file for obstacles (eg. bricks(images)) derived from Sprite. It have other attributes. For example:
@interface obstacles : Sprite
{
NSString *name;
int type;
int life;
int effectType;
int direction;
float speed;
int destroyType;
...............
.................
}
Now when I load xml file every time I write following line.
In loadxml.m file
obstacles *objObstacles = [obstacles alloc];
objObstacles.life = life;
objObstacles.direction = direction;
objObstacles.speed = speed;
[arrObstacles addObject:objObstacles];
& then I have one array (globally declared NSMutableArray *arrObstacles;) to store all obstacles. I add this object to this array.
So, suppose I have 30 - 40 obstacles in level then "objObstacles = [obstacles alloc];"
this will call 30 -40 times.
If i release that object after adding it to array it will give me error. is this thing increase memory. How can I solve this problem.
I am adding enemy, power in the scene same way.
Pls help me.