Change layout and back with same positions?

0 favourites
  • 7 posts
From the Asset Store
Vector illustration of a UFO with an alien in three different positions.
  • Hey there!

    I decided to make an inventory in a different layout, which the player goes to when opening inventory, but also to return to where the player was when closing inventory.

    The problem is; all enemies respawn when i change back to the current layout after closing the 'inventory' -

    I know that you have to set position for the character to return to where he/she was standing,

    but how do i save all dead enemies to be dead and all alive enemies to be alive, specially when the

    type of enemy spawn is random in the stage?

    Thanks in advance hehe

  • why don't you use layer instead of another layout?

  • why don't you use layer instead of another layout?

    Hehe hey! Thanks for your response! - Well i dont want it to sit in the background til' the player opens the inventory, it seems to be heavy on the engine no? 50 item slots, stats, lots of text displaying status, hp and mp etc.

    Isn't it better to go to a different layout?

  • Okay so no one knows? Maybe it cant be done then? hehe

  • You could use array in order to save all infos you need when you reload your layout

    But I suggest you to use a layer for your inventory

  • You could use array in order to save all infos you need when you reload your layout

    But I suggest you to use a layer for your inventory

    Hehe hey thanks for your response!

    Wouldn't that though slow down the game if i kept a layer in the background with pictures, numbers and over 50 items? While it stays in the background during gameplay? Thanks in advance hehe

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Greaver - make the enemy objects Global - so they are not destroyed when you leave the layout. If you randomly create them at the beginning of that layout you will need to set a global variable so that you know not to create them again when you go back to the layout.

    Having the inventory on the same layout shouldn't slow things down it you do it right. If you need lot of code to handle the inventory, you can put that in a group and disable it (the group) when the inventory isn't showing. Then there is no unnecessary code running to slow things down...

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