Having some trouble splicing


(Nate ) #41

If anyone has followed this thread, what would be the easiest way to have the spacebar remove the most recent item from the inventory?

I did something like this, which I know is wrong, but since it is not my code I am unsure of how to make this work exactly:

	  if (Input.pressed(Key.SPACE))
	  {
		  
		  
		   if(itemType == 0)
		  {
			for (var i:int = 0; i < 9; i ++)
		  {
			  tilemap.setTile(i, slotRow, 0); break;
		  }
		  }

		  
	  }