P
prithvidiamond
Guest
How to make button such that if a sprite exists at certain coordinates and the button is clicked it repeats a certain number of scripts again.
I tried this code but it didn't work:
if (mouse_check_button_pressed(mb_left) && point_in_rectangle(mouse_x, mouse_y, bbox_left, bbox_top, bbox_right, bbox_bottom) && sprite_get_xoffset(spr_fr_wm) = 80 && sprite_get_yoffset(spr_fr_wm) = 320 && sprite_exists(spr_fr_wm) && fruit = 0)
{
points += 1;
scr_draw_obj1();
scr_click_check();
}
Also there are 16 such buttons that need be created so if this extra bit information is required, then you have it. Another thing note is that there are 16 different sprites, each 1 appears in each button with a draw event which is randomized.
All suggestions and help is really appreciated!
PRITHVIDIAMOND.
I tried this code but it didn't work:
if (mouse_check_button_pressed(mb_left) && point_in_rectangle(mouse_x, mouse_y, bbox_left, bbox_top, bbox_right, bbox_bottom) && sprite_get_xoffset(spr_fr_wm) = 80 && sprite_get_yoffset(spr_fr_wm) = 320 && sprite_exists(spr_fr_wm) && fruit = 0)
{
points += 1;
scr_draw_obj1();
scr_click_check();
}
Also there are 16 such buttons that need be created so if this extra bit information is required, then you have it. Another thing note is that there are 16 different sprites, each 1 appears in each button with a draw event which is randomized.
All suggestions and help is really appreciated!
PRITHVIDIAMOND.