uj5u.com熱心網友回復:
程式寫的有問題,少括號分號的,具體什么問題,可以把代碼貼上來給大家看看uj5u.com熱心網友回復:
void updateWithoutInput()
{
int i, j;
if(bullet_x > 0)
bullet_x--;
if((bullet_x == enemy_x) && (bullet_y == enemy_y))
{
score++;
enemy_x = 0;
enemy_y = rand() % width;
bullet_x = 0;
}
if (enemy_x > high)
{
enemy_x = 0;
enemy_y = rand() % width;
}
if (speed == 1)
for (int i = 1; i<= 10000; i++)
{
for (int j == 1; j<= 1000; j++);
speed = 1;
}
speed = 0;
if (speed == 0)
{
enemy_x++;
speed = 1;
}
}
這是那部分程式,還請看一看
uj5u.com熱心網友回復:
void updateWithoutInput(){
int i, j;
if(bullet_x > 0)
bullet_x--;
if((bullet_x == enemy_x) && (bullet_y == enemy_y))
{
score++;
enemy_x = 0;
enemy_y = rand() % width;
bullet_x = 0;
}
if (enemy_x > high)
{
enemy_x = 0;
enemy_y = rand() % width;
}
if (speed == 1)
for (int i = 1; i<= 10000; i++)
{
for (int j = 1; j<= 1000; j++);
speed = 1;
}
speed = 0;
if (speed == 0)
{
enemy_x++;
speed = 1;
}
}
你去掉個=試試看
uj5u.com熱心網友回復:
這塊寫的有問題也有點亂if (speed == 1)
for (int i = 1; i<= 10000; i++)
{
for (int j == 1; j<= 1000; j++);
speed = 1;
}
speed = 0;
uj5u.com熱心網友回復:
還是不行,仍然有錯誤
uj5u.com熱心網友回復:
但是問題出在哪啊(●°u°●)? 」我實在是找不到
uj5u.com熱心網友回復:
我把你這個函式放到在線編譯器里面是沒有錯的,奇怪了,坐等其他大蝦來解決uj5u.com熱心網友回復:
if (speed == 1) //這里沒有寫大括號for (int i = 1; i<= 10000; i++)/這個回圈什么意思?
{
for (int j == 1; j<= 1000; j++); //for加了分號
speed = 1;
}
speed = 0;
uj5u.com熱心網友回復:
好的??知道了??感謝
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/56809.html
標籤:疑難問題
上一篇:sql存盤程序怎么做判斷
下一篇:棋牌搭建 資料庫sa登陸不上
