• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

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

E

Ecthelon

Guest
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 by a moderator:

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;   
}
 
E

Ecthelon

Guest
The issue persists. Your code has the same problem. Will fire unless I'm moving up and to the left.
 
E

Ecthelon

Guest
Issue also persists with creating different objects and/or sprites.
 

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
 
E

Ecthelon

Guest
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 by a moderator:
Top