What would be the best way to replace one object with another, and have the new object with it's own collision properties? For instance, in my game, the enemy will drop a bomb. If the player doesn't destroy the bomb, it'll hit the ground and leave a crater. The way I want to achieve this is to show an explosion animation, then replace the bomb with another object. If the player runs into this new object, he won't be able to move past it (a la Balloon Bomber, an old arcade game). Here's what I tried to do:
This obviously doesn't work due to the fact that I killed the enemyfire process. I tried a number of other ideas and can get the crater to stay on the screen, but there is no collision detection associated with it. Does this all make sense?
Any suggestions? I appreciate any and all help, and sorry for being such a newbie
Code:
process enemyfire(x,y);
begin
graph=3;
loop
y=y+20;
if (y=>420)
crater(x,y);
enfireflag=0;
frame;
end
if (collision (type ship))
signal(type ship, s_kill);
return;
end
frame;
end
end
process crater(x,y);
private
i;
begin
signal(type enemyfire, s_freeze);
for(i=4;i<9;i=i+1);
graph=i;
frame;
end
signal(type enemyfire, s_kill);
graph=8;
frame;
return;
end
This obviously doesn't work due to the fact that I killed the enemyfire process. I tried a number of other ideas and can get the crater to stay on the screen, but there is no collision detection associated with it. Does this all make sense?
Any suggestions? I appreciate any and all help, and sorry for being such a newbie