D
Dwighty4000
Guest
Why do the "x" and "y" jump back if the player ends to walk
I have a player object and I have a flashlight object. When the player is walking, the coordinates are taken over by the player and expanded to their "x + 100" and "y + 20".
But if the player is not walking, then it takes over the same coordinates from the player, but ignores the x + 100 and y + 20 ...
But why?
I have a player object and I have a flashlight object. When the player is walking, the coordinates are taken over by the player and expanded to their "x + 100" and "y + 20".
But if the player is not walking, then it takes over the same coordinates from the player, but ignores the x + 100 and y + 20 ...
But why?
Code:
#region Gesammelt-True
if (instance_exists(obj_player_escaperun_v2))
{
if (obj_player_escaperun_v2.PlayerL == true && global.taschenlampenaktiv == true && global.flashlightitemgesammelt == true)
{
x = obj_player_escaperun_v2.x;
y = obj_player_escaperun_v2.y;
x = x - 100;
y = y + 20;
sprite_index = spr_flashlight_item_L;
}
if (obj_player_escaperun_v2.PlayerR == true && global.taschenlampenaktiv == true && global.flashlightitemgesammelt == true)
{
x = obj_player_escaperun_v2.x;
y = obj_player_escaperun_v2.y;
x = x + 100;
y = y + 20;
sprite_index = spr_flashlight_item_R;
}
#endregion
#region Gesammelt-FALSE
if (global.taschenlampenaktiv == true && global.flashlightitemgesammelt == false)
{
x = 500;
y = 500;
sprite_index = spr_flashlight_item_R;
}
}
#endregion
Attachments
-
187.8 KB Views: 25
Last edited by a moderator: