Windows Object can't create instances while moving in a certain direction

Ecthelon

Member
I have a very odd issue. Either I'm missing something dumb or this is a bug I should submit.

I have a game with a spaceship that flies around. Pressing space fires a bullet in the direction you are facing, behind you, and to either side. This works fine unless I move up and to the left, in which case nothing happens at all.

I also tried adding a simple "create instance" while moving in that direction but that didn't work either, even with the "create moving instance" commands deleted.

See attached pictures for more.
Picture1.png Picture2.png Picture3.png Picture4.png Picture5.png
 
Last edited:

jonjons

Member
see if this code can help you
it fires bullets in all directions and angle directions
Code:
K_fire = keyboard_check_pressed(vk_space);

if (K_fire )
{
    var blt1 = instance_create(x, y, obj_BullSmall1);   
    blt1.direction = image_angle;
    blt1.image_angle = image_angle;

    var blt2 = instance_create(x, y, obj_BullSmall1);           
    blt2.direction = image_angle+45;
    blt2.image_angle = image_angle+45;
        
    var blt3 = instance_create(x, y, obj_BullSmall1);           
    blt3.direction = image_angle+90;
    blt3.image_angle = image_angle+90;
        
    var blt4 = instance_create(x, y, obj_BullSmall1);           
    blt4.direction = image_angle+135;
    blt4.image_angle = image_angle+135;   
        
    var blt5 = instance_create(x, y, obj_BullSmall1);           
    blt5.direction = image_angle+180;
    blt5.image_angle = image_angle+180;   
        
    var blt6 = instance_create(x, y, obj_BullSmall1);           
    blt6.direction = image_angle+225;
    blt6.image_angle = image_angle+225;       
        
    var blt7 = instance_create(x, y, obj_BullSmall1);       
    blt7.direction = image_angle+270;
    blt7.image_angle = image_angle+270;   
        
    var blt8 = instance_create(x, y, obj_BullSmall1);       
    blt8.direction = image_angle+315;
    blt8.image_angle = image_angle+315;   
}
 

TsukaYuriko

šŸŒ 
Forum Staff
Moderator
That's a problem with your keyboard, not with your code. This is a perfect example of a lack of rollover - you're pressing more keys than your keyboard can handle.

Also, please do not post images of code. Best practices for posting code can be found here: How to post code
 

Ecthelon

Member
Sorry about posting the code wrong. Can it be a rollover issue? Moving diagonally in the other directions and firing works fine.

Edit: I checked with aqua key test and you're totally right. That sucks deeply. I guess I can use another key that works. Thanks.
 
Last edited:
Top