C
captiongoosebut
Guest
First off, this isn't like ordinary snake game. I need a good way to have the segments follow in the path the player went, and in the correct order.
Right now my body segments follow the head part, and move from further away depending on the order they were created.
I use that variable to multiply the distance_to_object that it waits to check.
The addon variable was a solution I made to the following segments after the first, not being far enough away.
The problem I mostly face right now is that all the balls just follow blindy, but I want the to actually go in the path the player went, that way they dont just go through walls and ...
Edit: This is the kind of snake game I'm trying to emulate:
https://mattykins.com/game/danger-noodle
Right now my body segments follow the head part, and move from further away depending on the order they were created.
Code:
obj = instance_create(obj_char.x,obj_char.y,obj_segment);
obj.segments = instance_number(obj_segment);
Code:
if (instance_exists(obj_char))
{
if (obj_char.moving == true)
{
if (distance_to_object(obj_char) > (addon+5)*segments)
{
move_towards_point(obj_char.x,obj_char.y,4);
}
else
{
speed = 0;
}
}
else
{
move_towards_point(obj_char.x,obj_char.y,4);
}
}
The problem I mostly face right now is that all the balls just follow blindy, but I want the to actually go in the path the player went, that way they dont just go through walls and ...
Edit: This is the kind of snake game I'm trying to emulate:
https://mattykins.com/game/danger-noodle