Q
Quinnlan Varcoe
Guest
Hey everyone!
I was wondering why this code stopped working if the room changed even though the object was persistent.
Global Mouse left (obj_inventory)
I was wondering why this code stopped working if the room changed even though the object was persistent.
Global Mouse left (obj_inventory)
Code:
///Add a random item to the inventory
var gx = x_to_gx(mouse_x+17);
var gy = y_to_gy(mouse_y+17);
var add_item = choose(item.potion, item.bomb, item.sword);
if(count[# gx, gy] == 0) {
scr_add_item(gx, gy, add_item);
}
else if (count[# gx, gy] > 0) {
if (count[# gx, gy] < 99) {
count[# gx, gy] ++;
}
}