Hey everyone, I've got what is probably a simple question: I have some code that changes some variables as the path_position of my "oSun" and part of my code runs fine, but the other part doesnt seem to do anything.
So in my Create Event I have:
nightAlpha = 0;
path_position = room.x/2 + room.y/2;
path_start(pathSun, 100, path_action_stop, 0);
and in my Draw I have:
draw_self();
image_alpha = 0.4;
Sun();
if(path_position == 0.75)
{
nightAlpha += 0.1;
draw_sprite_ext(sNight,image_index,0,0,room_width,room_height,image_angle,image_blend,nightAlpha)
}
if (path_position == 1)
{
instance_destroy(self)
instance_create_depth(x,y,depth,oMoon)
global.light_alpha = 0;
}
The second if statement works great, but the " if (path_position == 0.75) doesnt seem to run any code when my path_position hits 0.75. Is it proper to run this in the draw event? I've tried it in Step event and it doesnt do anything either. Any help would be great, thanks.
So in my Create Event I have:
nightAlpha = 0;
path_position = room.x/2 + room.y/2;
path_start(pathSun, 100, path_action_stop, 0);
and in my Draw I have:
draw_self();
image_alpha = 0.4;
Sun();
if(path_position == 0.75)
{
nightAlpha += 0.1;
draw_sprite_ext(sNight,image_index,0,0,room_width,room_height,image_angle,image_blend,nightAlpha)
}
if (path_position == 1)
{
instance_destroy(self)
instance_create_depth(x,y,depth,oMoon)
global.light_alpha = 0;
}
The second if statement works great, but the " if (path_position == 0.75) doesnt seem to run any code when my path_position hits 0.75. Is it proper to run this in the draw event? I've tried it in Step event and it doesnt do anything either. Any help would be great, thanks.