How do I program flying and running platformer enemies

0 favourites
  • 7 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • So I'm making a platformer/bullet hell type thing but I'm having trouble with the enemies' behavior. I want some that run around on the ground, some that fly etc. but the only way I can think of programming them is with the platform behaviour (as gravity and solid interaction is necessary) but this absolutely ruins performance as I need around 20 enemies on screen. Is there a more efficient way to do this?

    On a similar note bullets colliding with walls is pretty expensive in terms of cpu when there are lots of bullets, any advice for this?

    Thanks!

    Here's the capx, sorry if the event sheet is a bit of a mess: https://www.dropbox.com/s/enepa24ikhhnp ... Thing.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is a tutorial how to make enemy ai. https://www.scirra.com/tutorials/40/bas ... and-arrays

    For flying enemies use 8 directions or custom movement behaviors.

    Are you doing this for mobile or pc? 20 enemies shouldn't be that bad on performance! For performance, just make them shoot less often, because I assume they're shooting on tick? ( can't open capx cause im on 163 )

    Then set it to every 0.5 sec for example. Also make sure that whatever is not necessary to be turned on, will be off if its not used.

  • I'll take a look at that guide, thanks! PC, I'll be honest though, I've only tested on a non gaming laptop but in the past my other games have ran fine. To be more specific, 40-50% of the cpu is taken up by "engine" and another 30-40% by events.

    They shoot every random(1,2) seconds at the moment. I have quite a few event groups that switch on/off when necessary so think I'm okay on that front.

    Thanks for your help, hopefully someone else will be able to open the capx and tell me I'm being an idiot!

  • Just an outside the box thought here for your flying enemies:

    Another option could be to give them the platform behaviour and get them to walk (fly) back and forth across invisible platforms with edge markers to stop them going off the edge

  • The way I currently do it is by making them platformers but with 0 gravity, this works better for me as the height they fly at isn't constant. I think the issue is too many platform behaviors anyway. But thanks for the suggestion

  • As a side note, if people who download it could check how it runs (so I know if there is an issue or not) that would be fantastic. Thanks!

  • For flying enemies you could give them the bullet behavior and set the angle to the player every 0.5 sec and you could use able them until the player can see them this way they are just sitting still until needed.

    You could also use the bullet behavior for waling enemies as well just have them run between 2 checkpoints.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)