TMAJA's Recent Forum Activity

  • You can download the capx by clicking the download button in the black bar at the top of the page

  • I've seen other people post about this on other areas of the forum but no one seems to ever get an answer

  • Although I haven't come across the problem myself (because I haven't tried to record anything yet) I'd like to know the answer to this also.

  • Hi, so the problem is you aren't calling the code for each enemy, you are running it for both at the same time.

    A way around this is to use a timer system for both enemies.

    I added another variable to your enemies, called Timer. Timer is the part that changes, cooldown is simply the total cooldown for each enemy.

    http://imgur.com/vjGziP1

  • Haha can I say magic? Honestly I'd love an explanation too - both of your problems were effectively caused by nested every X second events within a for each loop. It seems that this generally doesn't work? My best guess is that the interaction between the way the loop is executed and the every X seconds basically breaks the every X seconds.

    Feel free to PM me/quote me if you need any more help, if you just reply in here I might not necessarily see it .

  • You could increase your var_attackcountdown by one, which should introduce some variation in the pace at which your enemies attack. I just had a go and got two groups attacking at different times. If you want to keep the 1s attack time you could subtract 0.5 every second. That help?

  • Ok so I did a quick restructure and got what you want working . It was weirdness from the for each enemy loop and your subtract 1*dt. I removed the var6 code in the screenshot from the for each enemy loop and changed a couple of things.

    http://imgur.com/I9WklhU

    Ok I've added a link because the screenshot was crazy out of the box for some reason.

    This works how you want it, while the player is stood still. If you run through groups of enemies you will still see high hitbox values, because you are swapping var states as the player moves past and therefore removing the attack cool down associated with var6. I'd recommend adding another var (attack cool down) which is independent of the enemy state vars.

    Let me know if I can help anymore .

  • So I've had a play around with your Capx and as far as I can tell you don't need to remove all the var_state events from the for each enemy loop. The issue you described only seems to arise when you put the LOS condition inside the loop. When that condition is outside the loop, it all (seems) to work pretty well! Is that correct?

    I can only guess that this is caused by the system looping through the enemies quickly, which causes an problems with the calling of the every 2 second condition.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey, I can't identify an obvious problem from your events and it's a bit odd your first enemy works while the rest don't. I'm wondering if it is something to do with how your events are structured which is throwing the whole thing off.

    Could you post up/PM me your capx and I'll have a play around with it?

  • Are your levels dynamic/random or could you simply have a series of sprites over the different areas - when the player overlaps an 'inside sprite' you set the zoom to your desired level (using something like what puntodamar linked to above) and if they overlap an outside sprite you set the zoom to a much larger value. Although this is a bit binary, it would probably be a lot less stressful for the device performance wise.

  • Opens for me, I'm on r320.

  • Changing your 'window size' property will allow your camera to see more. You can access this by clicking on your top level project file in the project window.

    You should note that increasing the window size may also affect performance as the window size gets bigger (more for the system to draw/process at any one time).

    You could also scale all your sprites down so more fit on the screen.

TMAJA's avatar

TMAJA

Member since 13 Feb, 2014

None one is following TMAJA yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies