Remove Entity?
Displaying 1-11 of 11 total.
1
rao_dao_zao
|
I've got my fighting system up and running nicely; when slashed, enemies "explode." However, they are only hidden when they "die" (the last frame of the explosion CHR is pure death magenta); when the player slashes the "dead" entity, it blows up again. Euh. I was wondering, is there any way to completely remove an entity, without leaving it still somewhere on the map (thus freeing up memory etc)?
Posted on 2005-12-16 12:37:19
|
mcgrue
|
Not the solution you want, but I just usually move the entity "off" of the map. Completely. Like to (200,200) on a 100x100 map. That may or may not work depending on the build version, though.
Another trick I've used is a 'dead entity' corral in an off-screen corner of the map that's still technically on the map, like (99,99) on a 100x100 map. I always make an "off-screen" buffer zone of at least a half screen in size around all of my maps to avoid running into the edge's bounding box. That's merely an aesthetic choice, though.
Posted on 2005-12-16 12:55:21
|
rao_dao_zao
|
It'll have to do, I suppose. Thanks.
Another little problem I've got; in my code, so that some animations are played through visibly, I've been using the PlayerMove("W5") function... But this stops my player when it's not necessarily him doing anything. Is there a more generic wait function I can use?
Posted on 2005-12-16 12:58:13
|
pthaloearth
|
Do you want to pause the entire system? Or just the entities? Or perhaps just some entities?
Posted on 2005-12-17 01:19:46
|
resident
|
Set the entity.obstruct and entity.visible variables to 0 for the entity you want to "remove".
The only catch is it doesn't actually remove the entity, so you shouldn't just keep adding new entities to the map, but rather try and catch and reuse old ones. If you're just wanting an entity to "vanish" for the duration of a fight though, it'll probably do the job.
You'll probably want to check the entity beforehand, and make it unslashable if it's already dead.
Posted on 2005-12-17 02:22:49 (last edited on 2005-12-17 02:24:34)
|
rao_dao_zao
|
resident - Aye, that's what happens - the dying entity gets changed to unobstructable and its CHR goes to an explosion whose final frame is blank; so it effectively vanishes. I've just gone with McGrue's dead-entity-corrale idea; since they're unobstructable I shunt them to 0,0, where the player can't go.
pthaloearth - I don't want to pause anything, that's the point. But I need a delay or else the special animation plays so fast you can't actually see it.
Posted on 2005-12-17 04:03:23
|
Code
|
Quote: Originally posted by mcgrue
I always make an "off-screen" buffer zone of at least a half screen in size around all of my maps to avoid running into the edge's bounding box. That's merely an aesthetic choice, though.
Me too!
Posted on 2005-12-17 13:39:19
|
pthaloearth
|
you could use entityMove() instead of playerMove() which will keep everthing else in motion while the animation plays, only other option I can think of is to add alot more frames to the animation.
Posted on 2005-12-17 17:10:00
|
rao_dao_zao
|
Thing with entitymove is it doesn't seem to do the same delay; I've tried it, and the animation doesn't even show, it plays so fast.
Posted on 2005-12-18 05:21:45
|
rao_dao_zao
|
Thing with entitymove is it doesn't seem to do the same delay; I've tried it, and the animation doesn't even show, it plays so fast.
Posted on 2005-12-18 05:22:57
|
Omni
|
Of course, on NES and GBA development, that's what everybody else does too: when they're done with a sprite they move it off the screen.
Posted on 2005-12-18 12:12:03
|