G
Gustavo Miler
Guest
Hi, i'm new to programming and still learning, i want to make a inventory system that have visible slots at top and when i press Tab key it will show more slots, as a chest, for example. It's most based on Magicite and Roguelands system, for reference, i got to make it apear, but not disapear, it's an object called slot that replies himself in the room until it have enough i want, the problem is that i don't know how to destroy them, i've created a ds_grid with the information in a controller object so there's no problem by destroying them.
i made the inventory system entirely based on this https://forum.yoyogames.com/index.php?threads/flexible-inventory-system.34884/
It's basically a copy, could you guys help me?
the code at the controller object step event is like this:
It only destroy the last slot object.
Thanks in advance.
i made the inventory system entirely based on this https://forum.yoyogames.com/index.php?threads/flexible-inventory-system.34884/
It's basically a copy, could you guys help me?
the code at the controller object step event is like this:
Code:
var slot = 0;
if keyboard_check_pressed(vk_tab){
if inventory_open = false{
while (slot < 5)
{
inst1 = instance_create(x+8+(40*slot), y+50, oSlot);
inst1.var_slot = slot;
slot ++;
}
inventory_open = true;
}
else{
inventory_open = false;
with inst1{
instance_destroy();
}
}
}
Thanks in advance.