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

Discussion in 'Legacy GameMaker Community Tech Support' started by Ecthelon, Apr 23, 2019.

  1. Ecthelon

    Ecthelon Member

    Joined:
    Apr 23, 2019
    Posts:
    4
    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: Apr 23, 2019
  2. jonjons

    jonjons Member

    Joined:
    May 10, 2017
    Posts:
    293
    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;   
    }
     
  3. Ecthelon

    Ecthelon Member

    Joined:
    Apr 23, 2019
    Posts:
    4
    The issue persists. Your code has the same problem. Will fire unless I'm moving up and to the left.
     
  4. Ecthelon

    Ecthelon Member

    Joined:
    Apr 23, 2019
    Posts:
    4
    Issue also persists with creating different objects and/or sprites.
     
  5. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,535
    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
     
  6. Ecthelon

    Ecthelon Member

    Joined:
    Apr 23, 2019
    Posts:
    4
    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: Apr 23, 2019

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice