O
Oz Locke
Guest
I have a parent object called piece, and two children, white and black.
In the room, we just have the white and black pieces.
When a player clicks on a piece, it should change its value and sprite.
If I use the mouse event in the parent, with the following code, it works fine:
I'd prefer it all be done in the step event though, and after searching the forum this seemed to be the right way to do it:
But it doesn't work (literally, nothing happens on click)
I've tried putting it in the step events of the children and also targeting the child objects directly instead of using all
In the room, we just have the white and black pieces.
When a player clicks on a piece, it should change its value and sprite.
If I use the mouse event in the parent, with the following code, it works fine:
Code:
value++;
image_index = value -1;
Code:
var instance = instance_position(mouse_x, mouse_y, all);
if (instance != noone) && (mouse_check_button_pressed(mb_left)){
with(instance){
value++;
image_index = value -1;
}
}
I've tried putting it in the step events of the children and also targeting the child objects directly instead of using all