Level destroyed outside the screen "for performance"

Get help using Construct 2

Post » Tue May 09, 2017 2:31 pm

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.
B
6
S
2
Posts: 4
Reputation: 484

Post » Tue May 09, 2017 3:25 pm

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,
ImageImage
B
130
S
23
G
7
Posts: 1,078
Reputation: 13,280

Post » Tue May 09, 2017 3:52 pm

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.
...
B
47
S
25
G
7
Posts: 365
Reputation: 8,436

Post » Thu May 11, 2017 4:42 am

Message: Der83 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
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

https://www.dropbox.com/s/i1dj45rbgejaaub/M.rar?dl=0
B
6
S
2
Posts: 4
Reputation: 484


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 10 guests