Alemar5
Member
Hi everyone!
Some time ago I found a code that made more precise collisions and it still works, however I wanted to make some kind of ramp by changing the angle of the square, I have looked for several tutorials on the internet but I have only seen it in platform games, my game is an rpg So could someone help me to know how to do this? If someone could help me with this I would really appreciate it :,3
Then I leave you the code of the collisions and movement, I will also leave an image that better explains what I mean.
(the collision object only has the "solid" box checked and the collision mask is in "precise")
I thank you all in advance for your help :,3
Some time ago I found a code that made more precise collisions and it still works, however I wanted to make some kind of ramp by changing the angle of the square, I have looked for several tutorials on the internet but I have only seen it in platform games, my game is an rpg So could someone help me to know how to do this? If someone could help me with this I would really appreciate it :,3
Then I leave you the code of the collisions and movement, I will also leave an image that better explains what I mean.
GML:
///Create
vel = 3; //speed
is = 0.4; //Animation speed
GML:
if keyboard_check(global.left)
{
repeat(vel)
{
if place_free(x-5,y)
{
x--;
is = 0.4
}
else
{
is = 0
image_index = 0
}
}
sprite_index = spr_prota_izquierda
image_speed = is
}
if keyboard_check(global.right)
{
repeat(vel)
{
if place_free(x+5,y)
{
x++;
}
}
sprite_index = spr_prota_derecha
image_speed = is
}
if keyboard_check(global.up)
{
repeat(vel)
{
if place_free(x,y-4)
{
y--;
}
}
sprite_index = spr_prota_arriba
image_speed = is
}
if keyboard_check(global.down)
{
repeat(vel)
{
if place_free(x,y+2)
{
y++;
}
}
sprite_index = spr_prota_abajo
image_speed = is
}
I thank you all in advance for your help :,3