How do I load game resources

0 favourites
From the Asset Store
Mine those precious space resources & start trading
  • Right now I have a "GUI" layout with global objects that contains all of the GUI and is beginning to collect all of the sprites/enemies/etc off in the margin as well. I've noticed I have to be very careful with this because if you don't test the sprite before doing an action it will effect the source sprite as well!

    How do I load up all my resources so that there's no extra hanging around ?

  • Sorry, I have to bump this. I'm running into problems where sprites in the margin that I use as a base for spawning objects, are being treated as active. What is the normal way to do this? C2 makes it easy to put a bunch of "and is not in the margin" conditions, but that's going to be a lot of work already and I sense that's not the best way.

    ?

  • Could you provide an example capx?

    What do you mean by treated as active?

    If I understand correctly you could either put the sprites needed in a different layout or destroy them on start of layout..

  • http://surolace.com/play

    (swipe screen for virtual joystick)

    If you move the ship along the left edge and your screen res is high enough, you'll see the turrents on your ship aiming at something not accessible.

    If I delete the objects they will not be available for spawning, since C2 handles resources on a per layout basis. I've made them global so I can reuse them for (in the future) many instances.

    A simple solution might be something like, on every action "if not on resource layer" or something, but it's sloppy and won't scale with what I'm trying to do well.

    Edit: To reword more succinctly:

    I need to be able to spawn objects, but do not want to use or keep the original that they are based from.

  • Did you try my solutions?

    I have been working with C2 for about 2 years, so you might want to try..

  • I will give that a try when I get home this evening. So once they are loaded in a layout, they are there forever? won't I need to reload them again when changing layouts?

  • As long as the objects are available on any layout C2 knows what the starting point will be when created and or spawned..

    So you could do either of my suggestions

    on start of layout - destroy objects

    or create a layout witch isn't used for anything else than storing your assets..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Does not work. Just tried. The object needs to be present somewhere on the layout or system->create object does not work.

  • What did you try to do?

    put the object on a different layout or use the event on start of layout - destroy?

  • Here are the examples (although it shouldn't be necessary):

  • The game is set up as follows

    When you click campaign it goes to a layout called gui. gui contains all spawnable sprites and UI elements. The spawnable sprites are located in the margin off of the layout, and all objects are tagged as global.

    the GUI layout then redirects to whatever layout the player should be on.

    What I did as your suggestion is call:

    on layout start -> destroy spawnablesfamily

    right in the gui layout. But after redirecting it did not spawn any objects like it should have.

  • Why not create a dump layout which you dump all of your objects? Then, you don't have to destroy the objects on start of layout that you're using.

    If you're destroying global object, I think it will remove it entirely from the memory as well, maybe that's the reason it's not spawning.

  • I can't open the capx right now unfortunately but will when I can. If I understand what you're saying, the sprite can be on ANY layout, and if that's the case that would be extremely useful.

    I'll check back in later, thanks!

  • Why not create a dump layout which you dump all of your objects? Then, you don't have to destroy the objects on start of layout that you're using.

    If you're destroying global object, I think it will remove it entirely from the memory as well, maybe that's the reason it's not spawning.

    I didn't know I could do that Going to try later!

    Does the layout have to be loaded?

  • the sprite can be on ANY layout

    Yes, that is indeed the case.

    Does the layout have to be loaded?

    Nope, it'll load into memory at the very beginning of loading the index.html, I think.

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