atraub's Recent Forum Activity

  • that's good for limiting the number of bullets on the screen at 1 time, thanks

    how can I limit the rate of fire?

  • Spacedoubt, 'z 'was there as a placeholder, 'x' is the one I was actually working on. I know it looks complicated, but I'd like to walk you through the process a bit, my plan was to:

    when x is pressed and a bullet's boolean value of ready is set to true

    spawn a bullet

    set the angle of that bullet to a value corresponding to the pressed arrow keys (8 directions)

    Then set "Ready" to false signifying that the gun has been fired and can't be re-fired yet

    wait for a "reload time" that is set within the portal bullet

    and finally set ready to true signifying a new bullet can be pressed.

    Because I was intending for 8 directional shooting, not 2 directional shooting, I need something a bit more complex than simply looking at the direction the shooter is facing. (Further, the most glaring problem was that I was setting the bullet's angle rather than the angle of motion.)

    Lof, the fix works great! I can see you took the time to not only fix it but also use better programming practices. I really appreciate the effort you clearly put in. I would love it if we could talk about it a bit though.

    I see that you gave the shooter a "fireAngle" attribute that holds the direction that he's currently firing, Then you simplify it by having the shooting and the setting of the angle as two different steps, that way we can reduce a lot of repeated code, I really like the more modular approach.

    The only problem is, I was hoping to use the reload time to limit the rate at which the player can fire (I only set it to 3 seconds to exaggerate it for testing, in the real game it will be a much shorter time). The player can get around this pre-imposed limit simply by mashing the 'x' button. How could I change it so that the player is unable to shoot for a specified amount of time after each shot? Similarly, is there a way I can limit the number of bullets that can exist onscreen at a given time... i.e. The bullets are destroyed offscreen (I know that can be set in behaviors) and while there are 3 or more on screen, the player can't shoot.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey all, I've been working on a simple idea for about 2 days. What if I could create a game that has a character with mechanics similar to portal? I.E. he has a portal gun and can open up portals at will. I've been working on it a lot. I found a post about making portals that really helped and with some modifications I managed to make 2 way portals and I can open new portals with my gun But I do have problems...

    • I can't change the bullet direction, only the angle that the subsequent portal opens at
    • I can't reduce rate of fire, not sure what I'm doing wrong
    • Is there anything else you can see that is blatantly bad? I'm trying to make it in a way that leaves things open to have many, many playable characters.

    I'm new to Construct 2 (that's probably obvious) but I am an experienced software engineer, so I may be approaching these issues from the wrong frame of mind. Any advice you have would be extremely appreciated.

    EDIT:

    Also, it seems I suck at using this forums tags!

atraub's avatar

atraub

Member since 31 Jul, 2014

None one is following atraub yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies