Saludos B_12.4
La manera mas facil seria agregandole a una variable con el tiempo, prueba creando una variable tipo "hsp" y sumarsela a la "x"
hsp = 0;
maxhsp[0] = 4;
maxhsp[1] = 7;
maxhsp[2] = 9;
hithsp = 0;
hcont = 0;
htime = room_speed*3;
var kh;
kh = (keyboard_check(vk_right) - keyboard_check(vk_left));
if (kh <> 0 && !place_meeting(x+hsp, y, obj_solid) {
if (abs(hsp) < maxhsp[hithsp])
hsp += kh*0*5;
image_xscale = 1+(2*(hsp<0));
hcont += 1;
if (hcont >= htime && hcont != 2) {
hithsp = min(hithsp+1, 2);
htime += room_speed*2;
hcont = 0;
}
}
else
if (hsp <> 0 && kh == 0) {
var hx
if (hithsp == 0)
hx = 0.25;
else
hx = 0.5;
hsp -= (sign(hsp)*hx);
if (abs(hsp) > 4 && abs(hsp) < 7) {
hithsp = 1;
hcont = room_speed*3;
}
if (abs(hsp) > 0 && abs(hsp) < 4) {
hithsp = 0;
hcont = 0;
}
}
x += hsp;
Creo que con lo primero de ese ejemplo de se puede lograr prácticamente lo mismo, bueno apenas acabo de pensarlo :-[
intenta este sencillo.
if keyboard_check(vk_right) and place_free(x+8,y) {
speed+=1
direction=0
}
if keyboard_check(vk_left) and place_free(x-8,y) {
speed+=1
direction=180
}
if speed>8 {
speed=8
}
facilito, pero esos 8 de la speed y los place_free los puedes cambiar por los números que quieras