Va quedando muy bien el juego.
Esto parece que funciona
[gml]
xx += (keyboard_check(ord("D")) - keyboard_check(ord("A"))) * v;
yy += (keyboard_check(ord("S")) - keyboard_check(ord("W"))) * v;
x = lerp(x, xx, 0.2);
y = lerp(y, yy, 0.2);
if (x < 16) {
x = 16;
xx = x;
}
if (x > room_width-16) {
x = room_width-16;
xx = x;
}
if (y < 16) {
y = 16;
yy = y;
}
if (y > room_height-16) {
y = room_height-16;
yy = y;
}
[/gml]
Cambia 16 por un valor que se ajuste al tamaño de la nave
Deberías alinear el código para que sea más fácil de leer.
Esto parece que funciona
[gml]
xx += (keyboard_check(ord("D")) - keyboard_check(ord("A"))) * v;
yy += (keyboard_check(ord("S")) - keyboard_check(ord("W"))) * v;
x = lerp(x, xx, 0.2);
y = lerp(y, yy, 0.2);
if (x < 16) {
x = 16;
xx = x;
}
if (x > room_width-16) {
x = room_width-16;
xx = x;
}
if (y < 16) {
y = 16;
yy = y;
}
if (y > room_height-16) {
y = room_height-16;
yy = y;
}
[/gml]
Cambia 16 por un valor que se ajuste al tamaño de la nave
Deberías alinear el código para que sea más fácil de leer.