C
CrazyOmar
Guest
Hello.
I'm testing some gameplay features right now and one of them is an ability that forces all players (or the only one yet) to "travel back in time". This is achieved by adding a point to a path every few steps and reversing this whole path when activating said ability.
Now, it would be bad if the player gets reversed to the first position he entered the room at. That's why everytime there are more than 30 points for example, the first one gets deleted. The problem is that the whole path is kind of moving in random directions at this moment which doesn't help that much. This doesn't happen if the first point never gets deleted so it has to do with the deletion.
Is there a way to fix that problem?
My code:
Thanks for your support.
I'm testing some gameplay features right now and one of them is an ability that forces all players (or the only one yet) to "travel back in time". This is achieved by adding a point to a path every few steps and reversing this whole path when activating said ability.
Now, it would be bad if the player gets reversed to the first position he entered the room at. That's why everytime there are more than 30 points for example, the first one gets deleted. The problem is that the whole path is kind of moving in random directions at this moment which doesn't help that much. This doesn't happen if the first point never gets deleted so it has to do with the deletion.
Is there a way to fix that problem?
My code:
Code:
if(path_get_number(path) > 30) {
path_delete_point(path,0);
}