A
Amazing creature
Guest
When a player enters to a boss area the camera should move towards the boss and stay like that until it's defeated.
I sort of manage to do it, but I discover that if the player moves, while this is happening, it may move a little more to the right or left.
also, it moves first horizontally then vertically instead of moving directly towards it
The obj_camera is what the view follows, and this object follows the player.
obj_camera:
What makes the views value change is when it collides with an object that changes it (obj_view0, obj_view1, etc)
I have tried the move_towards_object function, but it shakes when it goes where is supposed to
I sort of manage to do it, but I discover that if the player moves, while this is happening, it may move a little more to the right or left.
also, it moves first horizontally then vertically instead of moving directly towards it
The obj_camera is what the view follows, and this object follows the player.
obj_camera:
Code:
// follow player
if views = 0
{
x = obj_player.x
y = obj_player.y
}
// stop following player and move towards a static object
if views = 1
{
if x > obj_enter.x
x -= 8;
if x < obj_enter.x
x += 8;
if y > obj_enter.y
y -= 8;
if y < obj_enter.y
y += 8;
}
I have tried the move_towards_object function, but it shakes when it goes where is supposed to
Last edited by a moderator: