Hello guys. So in my game when my player dies i want to respawn him at a checkpoint.But once i respawn him , i want to remove some entities also with him and respawn them too.And here is where i have problems.The code looks like this:
protected function reloadAtCheckpoint(mapData:Class):void
{
var mapXML:XML = FP.getXML(mapData);
//removing existing entities if they are
removeList(UnstableBlock, Crate, Amunition, EnemyBlue);
//respawning entities
addRespawnEntities(mapXML);
}
When in my world this function is called the game breaks and it gives me this error:
TypeError: Error #1034: Type Coercion failed: cannot convert UnstableBlock$ to net.flashpunk.Entity.
I don’t really know how to solve it/or if i’m using removeList correctly. Any tips/ideas? ty