public class TankGame {
public static void main ( String [ ] args ) {
final int WINDOW_ WIDTH = 800;
final int WINDOW_ HEIGHT = 800;
final float PI = 3.1415926F;
int x = 0;
int y = 0;
int w = 0; int h = 50;
int speed = 10;
boolean isLive = true;
float firection = PI/4;
int bulletSpeed = speed * 2;
System. out. println ( " 坦克當前位置:x=" +x+" y=" +y );
System. out. println( " 坦克向右移動一幀" );
x=x+speed; //x變,y不變
System. out. println( " 坦克當前位置:x1=" +x+" y1=" +y );
System. out. println( " 坦克向下縱向運動一幀" );
y+=speed;
System. out. println( " 坦克當前位置:x2=" +x+" y2=" +y);
System. out. println( " 坦克斜向45度運動一幀" );
System. out. println( " 坦克當前位置:坦克當前位置:x3=" +x+" y3=" +y );
}
}
uj5u.com熱心網友回復:
你把800后面的兩個; 換成英文輸入法的; 試一下uj5u.com熱心網友回復:
生命變數WINDOW_ WIDTH,WINDOW_ HEIGHT 多了個空格。錯誤提示都寫好了
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/162103.html
標籤:Java相關
