What happens when you die.

For questions about using Classic.

Post » Sat Sep 05, 2009 9:16 pm

I'm not talking about the big white light.
What happens to an object when its destroyed, and does it have any new characteristics, let alone old ones that can still be referenced?
For example I know that the object can still be referenced in the same event, but can that object be thought of as off-screen, invisible, etc, and can it be used as such in other events?
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Sat Sep 05, 2009 11:03 pm

Are you talking about that middle-frame time period where it's told to be destroyed, but there's still events picking that object type?

I'm pretty sure once it's destroyed, it can't ever be picked again, even if the event sheet hasn't finished running for that frame.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sat Sep 05, 2009 11:10 pm

you can usually reference that object, and use that object in certain ways after it is destroyed but before the next tick
for instance you can destroy a sprite, and then tell the same sprite to spawn another object
I haven't personally tested all the instances where this works, and what types of actions, conditions, and expressions still work until the end of the tick
but I believe ashley said that this will not be fixed in Construct 1,
because it is deeply entrenched in the picking, or event logic
after the tick, the object is completely destroyed in RAM
so, it's not invisible or off-screen, it's really gone
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Sun Sep 06, 2009 12:02 am

Just making sure its completely gone. I was having an issue picking in a sub event when I gave an object in the same family the same pv. I was thinking it was still referencing the same object, but it looks like it needs to be within another event or tick to do that.
Any way I was hoping some call like is destroyed, or is off screen might be useful, but a an additional pv, or perhaps a function could handle that.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Sun Sep 06, 2009 6:18 am

Objects dont actually disappear until the next frame, so you could for example do this:

player.destroy
create explosion at player.x, player.y

and it would work fine.
B
4
S
2
G
5
Posts: 641
Reputation: 3,011


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests