M
maranpis
Guest
Hello Guys,
First I want to say i'm just 2 months with gamemaker studio 2, so this is a noob question, hope you can help me:
I'm doing the moving_script for the player:
When I import a standar rectangle sprite all the movements works fine.
But when I change this for the animations, the player get stucks on the ground.
¿Why this is happening?
Thanks for your help.
----MORE INFO----
-I'm using Spine 2d but I exported all the animations frame by frame.
-The spirte size is 340x358.
-If the player is not touching the ground, left and right animations runs and moves fine.
First I want to say i'm just 2 months with gamemaker studio 2, so this is a noob question, hope you can help me:
I'm doing the moving_script for the player:
Code:
// Moving and collision
if keyboard_check(vk_right)
{
hospeed=20;
sprite_index=s_Running
image_xscale=1;
}
else if keyboard_check(vk_left)
{
hospeed=-20 ;
sprite_index=s_Running
image_xscale=-1;
}
else
{
hospeed=0;
sprite_index=s_Idle;
}
// COLLISION X
if place_meeting(x+hospeed,y,o_Ground)
{
while !place_meeting (x+sign(hospeed),y,o_Ground)
{
x+=sign(hospeed);
}
hospeed=0;
}
x+=hospeed;
//GRAVITY AND JUMPING
if !place_meeting (x,y+1,o_Ground)
{
vespeed+=grav
}
else
{
if keyboard_check_pressed(vk_up)
{
vespeed=-20;
}
}
// COLLISION Y
if place_meeting(x,y+vespeed,o_Ground)
{
while !place_meeting(x,y+sign(vespeed),o_Ground)
{
y+=sign(vespeed);
}
vespeed=0;
}
y+=vespeed;
When I import a standar rectangle sprite all the movements works fine.
But when I change this for the animations, the player get stucks on the ground.
¿Why this is happening?
Thanks for your help.
----MORE INFO----
-I'm using Spine 2d but I exported all the animations frame by frame.
-The spirte size is 340x358.
-If the player is not touching the ground, left and right animations runs and moves fine.
Attachments
-
54.6 KB Views: 4
-
21.6 KB Views: 3