Sprite duplication issue. [SOLVED]

  • Hi all!

    So I'm having a bizarre issue, and I've been scratching my head over it for two days now.

    Problem:

    Switching between certain layouts seems to bring sprites from the previous layout into the new one.

    Here's a quick video showing the objects piling up when switching back and forth (sorry the levels look so similar, I just want to fix this before making new ones!). You can see the layout name and the object count in the top left, and as I switch between them the objects increase. Level_02 starts with 375, for example, and ends with 751.

    dropbox.com/s/ld4m17a5k6n9w7h/objects-duplicating.mp4

    What I've tried:

    • Checked if layers are global. Nope.

    • Turned on and off each block of code and re-tested. Deleted most of the code. Nada.

    • Created a new layout from scratch (instead of simply duplicating the first one). Problem still exists, but read on ...

    Steps to reproduce / Leads:

    Weirdly, if I start the game on Level_01_Docks, then switch to others, I get the bug / duplication. If, however, I start the game on Level_02, or Level_03, and switch between them, it's fine. Going from either of them BACK to Level_01_Docks triggers the bug again. So I figure it's something to do with the layout Level_01_Docks, but for the life of me, I can't figure out what it is. The layouts Level_02 and Level_03 were created from scratch, as duplicating Level_01_Docks and renaming it still triggered the bug if you switch to it, no matter what the name is.

    I've never had this happen before and it's driving me a little nuts. I've stripped the project back to just 158 lines of code. Here's my project file on DB:

    dropbox.com/s/g5mlvz8gtscc0a1/pirate_planks-006-07_PROBLEMS.c3p

    You can switch back and forth between layouts by holding CTRL and pressing "," (previous) or "." (next).

    If anyone could take a look at this for me, it would be greatly, muchly appreciated! I assume it's something simple and stupid I've overlooked, but I've had my face to the monitor for too long and my eyes are becoming big pixels. []_[]

    Jimzip :D

  • The layers aren't global but the objects are. A bunch of objects in the Moving Objects family placed in the level are set to global with the tickbox, especially obj_docks_objects_01. That's also why cutting the code down won't have an effect, you need to uncheck the global setting in object properties as the problem is with the objects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The layers aren't global but the objects are. A bunch of objects in the Moving Objects family placed in the level are set to global with the tickbox, especially obj_docks_objects_01. That's also why cutting the code down won't have an effect, you need to uncheck the global setting in object properties as the problem is with the objects.

    plinkie it was so relieving to wake up to your reply this morning. ^^ Thank you very much! Glad it was something simple!

    Until now I didn't realise objects could also be global ... Very cool!

    Fixed, aaaaand moving on!

    Jimzip :D

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