Permanently dlete an object ala Metroid

This forum is currently in read-only mode.
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • Hey all. Just wondering if there was a way to delete something PERMANENTLY. Example being like in Metroid games, like how u shoot a block in the wall and it disappears. Please help. Much appreciated. Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Umm delete action? Every sprite has it under Misc

  • If you need them destroyed forever, even after loading a save game, or changing layouts to another and back, you could use a hash table, and add/store keys like..

    Pseudocode:

    On start of layout:

    Set global 'number' to 0

    For each family_destroyable

    • number: Add 1
    • Set family_destroyable object's variable 'id' to number
    • Hashtable: If key: LayoutName & number Doesn't exist, then add it
    • Otherwise, if hashtable key LayoutName & number Does exist, and it's 1, destroy this family_destroyable object.

    Then when destroying such a thing:

    Hashtable: Set key LayoutName & family_destroyable.value('number') to 1

    So you'd end up with a hashtable key names like, for a layout named 'Some House': Some House0, Some House1, etc.

    I suppose they'd get out of order when deleting one of the destroyable blocks.. Still, it's one way to do it.

    In short, using a hashtable to keep track of which objects are destroyed. You can then save and load the hashtable when needed.

  • Apparently Seagull didnt notice the bold face and upper cased word PERMANENTLY in my paragraph... Anyways thanks AshyRaccoon. In new to all this and still learning so every bit of help is appreciated.

  • It's hard to understand (despite the bold text) what you mean by permanently. I didn't get it, and there are new users here who might as well have asked for the destroy action. It is after all permanently deleted if you haven't saved it somewhere.

  • Well heres what happens, i mad a tile so when shot, it disappears (destroy) and u can access the room behind it. Using UberLous Warp tutorial, theres a spot that warps u to the secret room, than back to the first room. The tile that was destroyed returns every time i enter the room, even if i destroy it.

  • Then you have to store object properties globally (or externally, that works too). When you destroy an object in game, flag it as "DESTROYED" so that it won't be loaded again when you return to its layout.

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