Whenever my playable character dies in the game, I wanted him to fade out, while his soul (now in his position floats off the screen. Originally, I thought the soul would just be another view. But I don't know how to fade one view into another, so I devised making the soul an NPC and well, basically, here's the die function I made in the global...
Code: ags
Because I don't know what room the player will be in or what screen position he'll be in when he dies, it's difficult for me to figure how to bring the NPC (Jiva1) in. The reason I've used FollowExactly is so that he'll appear directly behind the player. And then after the player fade's out, there's the NPC floating away. But again, how do I script "bring cJiva1 into player's current room on player's current position"?
I was up all night working on this and am ready to give up on it altogether.
function die() {
StopMusic();
PlayMusic(5);
int trans = player.Transparency;
while (trans < 100) {
trans++;
player.Transparency = trans;
cJiva1.FollowCharacter(player, FOLLOW_EXACTLY, 1);
cJiva1.Walk(Random(340), 0, eNoBlock, eAnywhere);
Wait(1);
}
gDead.Visible = true;
gDead.Centre();
mouse.Mode = eModePointer;
}
Because I don't know what room the player will be in or what screen position he'll be in when he dies, it's difficult for me to figure how to bring the NPC (Jiva1) in. The reason I've used FollowExactly is so that he'll appear directly behind the player. And then after the player fade's out, there's the NPC floating away. But again, how do I script "bring cJiva1 into player's current room on player's current position"?
I was up all night working on this and am ready to give up on it altogether.