I'm trying to add a few polishing touches to my puzzle game (made in Game Maker) in the vein of Ironclad. The following code is for adding a gem object to a stack that already has at least one other object.
Everything works except the draw_line, for some reason. At first, I thought it was because
ds_stack_top().x didn't actually return the x value of the object on top of the stack. So, I replaced the points with random values, and those didn't work. It clearly runs past the code, since "did link" prints out.
I'm not sure what I'm doing wrong.
obj_Handle_Links.Match_Length +=1; //because we're increasing the length image_index = 1; //this should highlight Linked = true; //the gem's now linked var start_x = ds_stack_top(obj_Handle_Links.Link_Stack).x; //get the start point of the line var start_y = ds_stack_top(obj_Handle_Links.Link_Stack).y; //get the start point of the line show_message("did link"); draw_line(start_x, start_y, x, y); ds_stack_push(obj_Handle_Links.Link_Stack, id) //adds the instance to the stack