[英]Why doesn't changes in Eclipse Editor doesn't effekt my code?
我試圖更改另一台設備上的代碼,並通過Dropbox將代碼從另一台設備上轉移到另一台設備上,但是當我對代碼進行更改時,程序的行為與以前相同。 我不知道為什么?
//when collecting an Powerup-Item start a random Powerup
public static void pupHit() {
ItemCreator.powerUp.setLocation(new Point(-50, -50));
//usually I would generate a random number between 1 and 6
//with the commented 2 lines below and save it in the variable pup
//Random rand = new Random();
int pup = 6; //rand.nextInt(6) + 1;
//even if I give pup a static value of 6, pup differs between 1 and 5/6
switch(pup){
case 1: ItemPowerups.speed(); Stats.points += 10; break;
case 2: ItemPowerups.slow(); Stats.points += 5; break;
case 3: ItemPowerups.lsd(); Stats.points += 15; break;
case 4: ItemPowerups.invert(); Stats.points += 25; break;
case 5: ItemPowerups.obstacle(); Stats.points += 10; break;
case 6: ItemPowerups.steelJawbone(); Stats.points += 10; break;
}
}
我試圖添加System.out.printl(pup);
在聲明和初始化pup
。 這也不會影響我的代碼。
嘗試再次構建它:D。 (我知道最后一個人解決了這個問題,但是我們需要一個問題才能給出答案)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.