GameMaker (Solved) activate and deactivate instance by id

S

Shadowblitz16

Guest
does anybody know how to deactivate and activate a instance by id?
Code:
/// @description Insert description here
// You can write your code in this editor

event_inherited()

var dx1 = screen_y;
var dy1 = screen_x;
var dx2 = screen_y+screen_height/16;
var dy2 = screen_x+screen_width/16;

for (var cy=dy1; cy<dy2; cy++)
for (var cx=dx1; cx<dx2; cx++)
{
    var combo = Game.combos[# cx, cy];
    var cx1   = combo.x;
    var cy1   = combo.y;
    var cx2   = combo.x+16;
    var cy2   = combo.y+16;
   
    if (cx1 < dx2 && cy1 < dy2 && cx2 >= dx1 && cy2 >= dy1) 
        instance_activate_object(combo);
    else
        instance_deactivate_object(combo);
       
    if (combo != undefined)
        draw_tile(combo.tileset, combo.tile, 0, (x+1)+(cx*16), (y+1)+(cy*16));
    else
        draw_sprite(spr_null, /*ALIGNMENT*/  0, (x+1)+(cx*16), (y+1)+(cy*16));
}
 
S

Shadowblitz16

Guest
combo is an instance id
also i'm not sure what was wrong but I got it. thankyou
 
Top