woods
Member
having an issue with my player sprite not changing properly. the image changes when i have a collision with the selection ship.. however, all but the first image is offset by -90degrees .
ive tried several approaches to changing the image_angle.. in the selection ship's sprite.. in the creation code of the instance placed in the room.. in the step event where the player collides with the ship..
obj_player create event
obj_player step event
also i have a handful of instances of obj_ship_select_P1 placed in the room editor with creation code
image_index is increased for each instance in the room to designate the different ships the player can select
i am completely stumped as to why it works fine with the first one but not the rest.
the sprite is offset by -90degrees in all but the first ship (index 0)
ive tried several approaches to changing the image_angle.. in the selection ship's sprite.. in the creation code of the instance placed in the room.. in the step event where the player collides with the ship..
obj_player create event
Code:
/// initialize vars
image_index = spr_P1 // default sprit no ship
turn_spd = 1; // image_angle
thrust = 0.01; // motion_add
spd = 2; // speed clamp
obj_player step event
Code:
/// select ship
var inst;
inst = instance_place(x, y, obj_ship_select_P1);
if inst != noone
if (inst.image_index = 0)
{
sprite_index = spr_ship_0;
turn_spd = 3;
thrust = 0.03;
spd = 3;
}
else
if (inst.image_index = 1)
{
sprite_index = spr_ship_1;
turn_spd = 2;
thrust = 0.02;
spd = 2;
}
else
if (inst.image_index = 2)
{
sprite_index = spr_ship_2;
turn_spd = 4;
thrust = 0.04;
spd = 4;
}
else
if (inst.image_index = 3)
{
sprite_index = spr_ship_3;
turn_spd = 5;
thrust = 0.05;
spd = 5;
}
Code:
image_index = 0
image_speed = 0
i am completely stumped as to why it works fine with the first one but not the rest.
the sprite is offset by -90degrees in all but the first ship (index 0)