Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. //Dies ist das Inventar des Spielers
  3. Inventory = function(){
  4.     this.slots = 0;
  5.    
  6.     this.slot = new Array();
  7.    
  8.  
  9.    
  10.    
  11.     this.addSlot = function(){
  12.         if(this.slots >= 0){
  13.             this.slots += 1;
  14.             player[0].inventory.slot[player[0].inventory.slots] = new ItemSlot();
  15.             slots.innerHTML += slotDiv;
  16.         }
  17.     }
  18.         this.removeSlot = function(){
  19.         if(this.slots >= 1){
  20.             window["slotdiv" + (player[0].inventory.slots)].parentNode.removeChild(window["slotdiv" + (player[0].inventory.slots)]);
  21.            
  22.             delete this.slot[(this.slots)];
  23.             this.slots -= 1;
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement