System.out.println ("The door slowly sides open and reveals a golden sword, enter 1 to pick it up");
String pickupsword = scanner.next();
p.addItemToInv("Golden Sword");
這是從玩家級的我做了文字遊戲盤點系統發出
public class Player {
public void addItemToInv(String name){
for (int i = 0; 1 < inv.length; i++){
if (inv[i] == null)
{
inv[i] = name;
System.out.println ("you have added" + name + " .");
return;
}
}
System.out.println ("You have no room in your inventory");
}
private static String inv [] = new String [5];
}
現在我難倒打電話,讓說,我想用戶實際使用的劍,我會必須建立一個庫存系統嗎?
目前還不清楚你在這裏問的是什麼......是的,如果你想讓你的程序做些什麼,你必須編寫代碼來完成它。注意'1
2014-09-30 06:07:56
對不起,我的信息混亂了。我所要求的主要是幫助前進,再次抱歉。 – METEORITES 2014-09-30 06:33:10