woods
Member
i am having an issue with getting my player to select one of many ships properly.
i have 10 obj_player_select_P1 placed in the starting room. with creation code image speed = 0 and image index = 0 thru 9 (one for each instance)
the idea is to move my player over the object in the starting room to select the particular ship.
obj_P1 step event
the above code is only for the first 2 ships.. [0] and [1] ... i figured get it working to swap between 2 before i try 10 ;o)
with the ship_select object, i have some debug text showing the image index above each ship..
i have 0 thru 9 on each as expected
the issue i am having is the player will change to the first ship only, no matter which one it touches.
looking for some guidance, if you would be so kind
i have 10 obj_player_select_P1 placed in the starting room. with creation code image speed = 0 and image index = 0 thru 9 (one for each instance)
the idea is to move my player over the object in the starting room to select the particular ship.
obj_P1 step event
Code:
/// select ship
if (place_meeting(x,y,obj_ship_select_P1))
{
if (other.image_index = 0)
{
sprite_index = spr_ship_0;
turn_spd = 3;
thrust = 0.03;
spd = 3;
}
}
if (place_meeting(x,y,obj_ship_select_P1))
{
if (other.image_index = 1)
{
sprite_index = spr_ship_1;
turn_spd = 5;
thrust = 0.05;
spd = 5;
}
}
with the ship_select object, i have some debug text showing the image index above each ship..
Code:
draw_text_transformed(x,y-64, "image index: " + string(image_index),2,2,0);
the issue i am having is the player will change to the first ship only, no matter which one it touches.
looking for some guidance, if you would be so kind
Last edited: