Page 1 of 1

Game Crash!

PostPosted: Sun May 08, 2005 4:27 am
by Editor
My game crashed!

I was working on a command that would make my player constantly lose life whenever he walked into a spike trap, and if his life value were to reach zero, he'd die. My command didn't work out as planned however, because it kept making the life value zero whenever it collided. So I decided to change if to while, and then when I collided with the spike trap game editor completely froze!

Nothing worked at all, had to use Windows Task Manager to close GE. The Game Editor version I use is 1.2.8 trial, and my Windows version is Windows 98.

PostPosted: Mon May 09, 2005 1:27 pm
by makslane
You might have created a infinite loop using the while.
What's your code?

PostPosted: Sat May 14, 2005 12:33 am
by Editor
I think that was the problem. I changed while back to if and it works fine now, but I still need to know how to do the life value. At the moment it's an instant kill if you hit the traps, but I'd rather it was a gradual health loss (100 to 0, and gameover at 0).

PostPosted: Sat May 14, 2005 1:22 pm
by makslane
When your player collides with the trap, don't destroy the player.
Use something like this in the player actor:

life = life - 1;
if(life <= 0)
{
DestroyActor("Event Actor"); //Destroy the player
}