VentKazemaru
Member
I'm working on walking animation of a dragon. The dragon is modular, his body is made of objects that I will swap the sprites with so his body can take different forms.
The entire thing is made in a sequence and it looks good initially
but I notice the body of the dragon bugs out a bit when in motion for a while. but the head stays in place. I don't know what's causing this
If I'm doing this right. I have two sequences of the idle and walking animation. and they swap out depending on action taken, they are otherwise stored in the void until needed.
am i doing this right? it's hard to tell since it's hard to find more experiences with sequences. is anything my code is causing the dragon to move like that?
The entire thing is made in a sequence and it looks good initially
but I notice the body of the dragon bugs out a bit when in motion for a while. but the head stays in place. I don't know what's causing this
If I'm doing this right. I have two sequences of the idle and walking animation. and they swap out depending on action taken, they are otherwise stored in the void until needed.
Code:
//player create event
dragon_idle=layer_sequence_create("Assets_2",x,y,seq_dragon_idle);
dragon_walk=layer_sequence_create("Assets_2",-100,-100,seq_dragon_run);
Code:
var dx = (global.right - global.left);
var dy = (global.down - global.up);
// is shooting in some direction:
if (dx != 0 || dy != 0) {
// (instance_create_layer(x, y-5, "sort_begin",oSpore)).direction = point_direction(0, 0, dx, dy)
// image_angle=point_direction(x, y, x+dx, y+dy)
}
if global.right
{ layer_sequence_xscale(dragon_walk, 1);
layer_sequence_xscale(dragon_idle, 1);}
if global.left
{ layer_sequence_xscale(dragon_walk, -1);
layer_sequence_xscale(dragon_idle, -1);}
if dx !=0 || dy!=0
{//moving
if layer_sequence_exists("Assets_2",dragon_walk)
{
layer_sequence_x(dragon_walk, x);
layer_sequence_y(dragon_walk, y);
layer_sequence_play(dragon_walk);
}
if layer_sequence_exists("Assets_2",dragon_idle)
{
layer_sequence_x(dragon_idle, -100);
layer_sequence_y(dragon_idle, -100);
layer_sequence_pause(dragon_idle);
}
}
else
{
//standing
if layer_sequence_exists("Assets_2",dragon_idle)
{
layer_sequence_x(dragon_idle, x);
layer_sequence_y(dragon_idle, y);
layer_sequence_play(dragon_idle);
}
if layer_sequence_exists("Assets_2",dragon_walk)
{
layer_sequence_x(dragon_walk, -100);
layer_sequence_y(dragon_walk, -100);
layer_sequence_pause(dragon_walk);
}
}
am i doing this right? it's hard to tell since it's hard to find more experiences with sequences. is anything my code is causing the dragon to move like that?
Last edited: