本当にタイミングもデバッグモードで止めても意味がわからないままです
今まで動いていたのに敵を追加した瞬間に動かなくなりました
class EnemyEx :public CObject{
protected:
int cnt;
float x, y;
float a, sp;
public:
EnemyEx(float x,float y,float a,float sp):CObject(O_ENEMY,0.3){
this->x=x;
this->y=y;
this->a=a;
this->sp=sp;
this->cnt=0;
};
virtual ~EnemyEx(){}
float GetX(){
return this->x;
}
float GetY(){
return this->y;
}
virtual void Move()=0;
virtual void Draw()=0;
};
class Enemy_Kikibongo :public EnemyEx{
int stop_time, restart_time;
float Update_Angle;
int state;
public:
Enemy_Kikibongo(float x,float y,float a,float sp,int stop_time,int restart_time,float Update_Angle)
:EnemyEx(x,y,a,sp){
this->stop_time=stop_time;
this->restart_time=restart_time;
this->Update_Angle=Update_Angle;
this->state=0;
}
~Enemy_Kikibongo(){
delete this;
}
void Move();
void Draw();
};
void Enemy_Kikibongo::Move(){
this->cnt++;
float angle=0;
Player *pl=(Player*)Object_Manager::GetTask(O_PLAYER,0);
if(pl!=NULL)angle=atan2(pl->GetY()-this->y,pl->GetX()-this->x);
switch(this->state){
case 0:
this->x+=cos(this->a)*this->sp;
this->y+=sin(this->a)*this->sp;
if(this->cnt == this->stop_time){
state=1;
cnt=0;
}
break;
case 1:
if(this->cnt == this->restart_time){
state=2;
cnt=0;
this->a=this->Update_Angle;
}
if(cnt == 0){
for(int j=0;j<3;j++){
for(int i=0;i<3;i++){
Object_Manager::AddTask(new BulletEx(this->x,this->y,angle-PI2/48+PI2/48*i,5+j,B_SMALL,ORANGE,DX_BLENDMODE_ADD,255));
}
}
}
break;
case 2:
this->x+=cos(this->a)*this->sp;
this->y+=sin(this->a)*this->sp;
break;
}
if(cnt > 500)this->used=false;
}
void Enemy_Kikibongo::Draw(){
MyDrawRotaGraph(this->x,this->y,1,0,en_bongoG[0],TRUE,1);
}