i figured i'd start another thread because it's a new question.
Array of objects;
Code:
bool Bullet::move(){
if(loc.X > BLEFT && loc.X < BRIGHT && loc.Y > BTOP && loc.Y < BBOTTOM){
switch (dir){
case UP:
loc.Y--;
break;
case DOWN:
loc.Y++;
break;
case LEFT:
loc.X--;
break;
case RIGHT:
loc.X++;
break;
}
this->drawBullet();
return true;
}
else {
this->outBound();
return false;
}
}
..........
int main {
.........
Bullet *bull[4];
bull[0]=new Bullet(20,10,RIGHT);
bull[1]=new Bullet(20,10,LEFT);
bull[2]=new Bullet(20,10,DOWN);
bull[3]=new Bullet(20,20,UP);
while(true){
for(int i=0; i < 4; i++){
if(bull[i] != 0)
thePlay->drawPlayer();
if(!bull[i]->move()){
delete bull[i];
bull[i]= 0;
}
........
}
It worked before, but now it doesn't!