Permanently dlete an object ala Metroid

For questions about using Classic.

Post » Tue Sep 22, 2009 2:53 am

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.
B
2
G
3
Posts: 21
Reputation: 892

Post » Tue Sep 22, 2009 8:04 am

Umm delete action? Every sprite has it under Misc
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Tue Sep 22, 2009 11:23 am

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.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Tue Sep 22, 2009 4:46 pm

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.
B
2
G
3
Posts: 21
Reputation: 892

Post » Tue Sep 22, 2009 5:40 pm

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.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Wed Sep 23, 2009 5:09 am

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.
B
2
G
3
Posts: 21
Reputation: 892

Post » Wed Sep 23, 2009 10:24 am

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.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests