Level destroyed outside the screen "for performance"

0 favourites
  • 4 posts
From the Asset Store
Unlock Levels, Worlds & skin plus add coins by watching ads
  • hi everyone

    I would like to know, how can I do that only what is seen on the screen is working, and what this outside screen is destroyed, I mean everything, level, enemies, everything.

    And as I go forward, create, while what I leave behind is destroyed.

    This would be for performance as my resolution is 1366 x 768

    And it's a game that must go through many stages

    Thank you for reading.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Der,

    You have the inverse of "IsOnScreen", you could also use the distance from the player object for checking that things will be off screen. Lot of work for potentially not much gain though, I would do some basic tests to make sure you will get a noticeable difference before getting too far into it,

  • I think the tile map object already works like this, as it allows you to create huge levels with small draw calls only rendering what is on the screen. For enemies you can just create spawn points in your level that spawn when a certain distance from screen and destroy after screen.

    Otherwise the only way I can think of to do what you want is to use arrays to store your level tile positions and enemy positions and keep looking up the array to create tiles and enemies in the right position when the player is close.

    But to do this you will first need to create a level editor to create your levels and enemy positions then store them to arrays and make code so your game can read the arrays produced by the editor.

    Creating a level editor could, potentially, be more complex than creating the game itself, but it is a common thing to do and construct gives you nice form tools to use for such a thing.

    as GenkiGenga said though run some tests with the tools that Construct 2 gives you first before you start thinking about other ways.

  • Thank you for your attention

    To tell you the truth, I do not use tile map, they are sprites located only

    I know it's not the right way, but I want to do it for a high resolution game

    This is an example of what I am doing

    dropbox.com/s/i1dj45rbgejaaub/M.rar

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