Should I stop enemy's outside the layout.

0 favourites
  • 3 posts
  • Hi, I am making a platform game, there are multiple enemy's outside the layout. Should I disable these until they come into view? And if so, how would I do this?

    Thanks for the help :-)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Should I disable these until they come into view? That depends on the game design but generally if they are not needed then they don't need to exist there, you can create them when they are needed.

    And if so, how would I do this? There is a condition on the enemy object 'is outside layout' you can use this to pick the ones outside of the layout and disable them.

  • Generally that is a good idea, unless you specifially want enemies to act even if offscreen. You´ll have to think carefully about that though, as enemies tend to walk around and fall off the map (for example) so they won´t be there when the player finally reaches that part. Also it takes additional processing power, that may or may not be a problem depending on the device.

    You´ll probably want to add all your enemies into a family and use "Is on screen"

    However, this will cause enemies to only do things when on-screen and stop everything as soon as they are off-screen (this can look weird), so you probably want to use an instance variable (boolean) that you set to true once the enemy is on-screen and "activate" the enemy this way, so it won´t stop moving (potentially mid-air) just because the player moved a little bit to the left.

    I personally would use a slightly different approach though, to make enemies activate at a certain distance even if still offscreen as I think this will create the best feeling result. (This essentially emulates how this works in Mariomaker apart from some weird cases)

    I dropped a ton of info so if you need some more help just ask :)

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