jaaldis
Member
Basically I'm trying to create three instances of an object called oShopItems. I'm using a "with" statement to try and externally change the positions of each of these three instances once they are created. The code (using a persistent meta obj) looks like this:
Within oShopItems "create" event, the code looks like this:
And then oShopItems also has a "draw" event which looks like this:
When I change the DrawHereX and DrawHereY values inside the oShopItems "create" event, it works fine. But I want to change it within "var (Obj1)" from within the meta object. Nothing happens when I do this though.
Any help would be greatly appreciated!
GML:
var shop1 = collision_rectangle(280, 200, 318, 220, oShopItems, true, true)
if shop1 = noone && global.storeClosed = false && (!shopItems) {
var Obj1 = room_instance_add(rStuffPlaceInterior, 300, 211, oShopItems);
with (Obj1)
{
DrawHereX = 300
DrawHereY = 211
}
shopItems = true;
}
Code:
depth = 100;
shop_item[0] = sBookcase_01
shop_item[1] = sCoffee_Table_01
shop_item[2] = sRug_01
shop_item[3] = sRug_02
shop_item[4] = sCake_01
shop_item[5] = sChair_01
shop_item[6] = sLamp_01
shop_item[7] = sLamp_02
shop_item[8] = sHaunted_Doll_01
shop_item[9] = sTV_01
shop_item[10] = sConspiracy_Board
random_object = shop_item[irandom_range(0,10)]
DrawHereX = 0;
DrawHereY = 0;
GML:
draw_sprite(random_object, 0, DrawHereX, DrawHereY);
Any help would be greatly appreciated!