E
Edoran
Guest
Hello,
Basically I have created a playing 'board' that randomly generates out of various objects 'tiles'. I want to be able to rotate a single instance of one of these 'tiles' without it affecting other 'tiles' that are the same object.
My code (probably super inefficient) looks like this:
//in the 'left button' event in obj_rotL (selecting the rotate tool)
global.rotL = true;
cursor_sprite = spr_rotL;
//then in 'step' event in obj_p1 (the object I am trying to rotate)
if global.rotL = true && mouse_check_button(mb_left)
{
if position_meeting(mouse_x,mouse_y,obj_p1)
{
if image_angle = 0
{
image_angle = 270
}
else if image_angle = 90
{
image_angle = 0
}
else if image_angle = 180
{
image_angle = 90
}
else if image_angle = 270
{
image_angle = 180
}
}
}
else{}
//Here I would then set the variable global.rotR = false
So far, when I click on one of the tiles I want to rotate, it rotates all of the tiles across the board that are the same object.
Any help appreciated,
Thanks
Basically I have created a playing 'board' that randomly generates out of various objects 'tiles'. I want to be able to rotate a single instance of one of these 'tiles' without it affecting other 'tiles' that are the same object.
My code (probably super inefficient) looks like this:
//in the 'left button' event in obj_rotL (selecting the rotate tool)
global.rotL = true;
cursor_sprite = spr_rotL;
//then in 'step' event in obj_p1 (the object I am trying to rotate)
if global.rotL = true && mouse_check_button(mb_left)
{
if position_meeting(mouse_x,mouse_y,obj_p1)
{
if image_angle = 0
{
image_angle = 270
}
else if image_angle = 90
{
image_angle = 0
}
else if image_angle = 180
{
image_angle = 90
}
else if image_angle = 270
{
image_angle = 180
}
}
}
else{}
//Here I would then set the variable global.rotR = false
So far, when I click on one of the tiles I want to rotate, it rotates all of the tiles across the board that are the same object.
Any help appreciated,
Thanks