Tjena, sitter och gör en javascript array som jag vill stoppa in 11 element i, dock tar den bara emot 8 och skippar resten.
Min "Klass":
function Item(name, owned, craftTime, stoneCost, copperCost, ironCost, silverCost, goldCost, platinumCost, diamondCost,copperBarCost,ironBarCost, gearsCost, electronicChipCost) {
this.name = name;
this.owned = owned;
this.craftTime = craftTime;
this.stoneCost = stoneCost;
this.copperCost = copperCost;
this.ironCost = ironCost;
this.silverCost = silverCost;
this.goldCost = goldCost;
this.platinumCost = platinumCost;
this.diamondCost = diamondCost;
this.copperBarCost = copperBarCost;
this.ironBarCost = ironBarCost;
this.gearsCost = gearsCost;
this.electronicChipCost = electronicChipCost;
this.bonusCollected = false;
}
skapar objekt av klassen:
var copperBar = new Item("copperBar", 200, 1000, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var ironBar = new Item("ironBar", 100, 5000, 0, 0, 10, 0, 0, 0, 0 ,0, 0, 0, 0);
var furnance = new Item("furnance", 0, 10000, 10000, 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0, 0, 0);
var tunnelSupport = new Item("tunnelSupport", 0, 15000, 0, 10000, 10000, 0 ,0 , 0, 0 ,100, 100, 0, 0);
var diamondDepth = new Item("diamondDepth", 0, 30000, 0, 10000000, 1000000, 0, 1000000, 0, 0 ,1000, 1000, 0, 0);
var miningCart = new Item("miningCart", 0, 30000, 0, 300, 300, 0, 0, 0, 0 ,30, 30, 0, 0);
var copperPickaxe = new Item("copperPickaxe", 0, 5000, 0, 10000, 0, 0, 0, 0, 0 ,100, 0, 0, 0);
var goldPickaxe = new Item("goldPickaxe", 0, 5000, 0, 0, 0, 0, 10000, 0, 0 ,1000, 1000, 0, 0);
var gears = new Item("gears", 0 ,5000, 0, 0, 0, 0, 0, 0, 0, 200, 100, 0, 0);
var electronicChip = new Item("electronicChip" , 0, 20000, 0, 0, 0, 0, 0, 10000, 10, 0, 0, 0, 0);
var personalRobot = new Item("personalRobot", 0 ,100000, 1000000, 1000000, 0, 0, 0, 0, 0, 0, 0, 20, 1);
försöker lägga till dem (bara 8 går in):
var allItems = [copperBar, ironBar, furnance, tunnelSupport, diamondDepth, miningCart, copperPickaxe, goldPickaxe, gears, electronicChip, personalRobot];
någon som har någon smart fundering? :O
Mvh Pressbyron