You can create flags. And when your character touches something, it signals a flag. Then all you have to read is if (collisionflag == 1)
{
blow up spaceship
}