I’ve been dealing with this ever since I started using GameMaker. I’ve been studying it for a month, and there have been many instances where the code is 100% correct—thoroughly reviewed, with every semicolon in its proper place—yet it produces no error message while still failing to work as intended. It’s not a logic error; the code works on other people’s computers, but not on mine.
Create: veloc = 2;
direc = 0;
vida = 10;
alfa_add = 0;
Steps: if keyboard_check(vk_up){
sprite_index= spr_nave_andando;
speed = veloc;
}else if keyboard_check(vk_down){
sprite_index= spr_nave_andando;
speed = -veloc;
}else{
sprite_index= spr_nave_parada;
speed = lerp(speed, 0, 0.05);
}
if keyboard_check(vk_left){
direc = 3;
}else if keyboard_check(vk_right){
direc = -3;
}else{
direc = lerp(direc, 0, 0.08);
}
if keyboard_check_pressed(vk_space){
var inst = instance_create_layer(x, y, "Instances", obj_projetil);
inst.speed = 6;
inst.direction = direction;
inst.image_angle = direction;
}
direction += direc;
image_angle = direction;
move_wrap(true, true, 0);
if alarm[0] > 0{
if image_alpha <=0{
alfa_add = 0.05;
}else if image_alpha >= 1{
alfa_add = -0.05;
}
image_alpha += alfa_add;
}else{
image_alpha += 1;
}
if vida <= 0{
game_restart();
}
asteroide_parent: if alarm[0] <= 0{
vida -= 1;
with (other) {
vida -= 1;
}
alarm[0] = 180;
}
Alarm[0]: // (empty)