Game Crash!

Non-platform specific questions.

Game Crash!

Postby Editor » Sun May 08, 2005 4:27 am

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.
Editor
 
Posts: 20
Joined: Fri Apr 22, 2005 7:32 pm
Score: 0 Give a positive score

Postby makslane » Mon May 09, 2005 1:27 pm

You might have created a infinite loop using the while.
What's your code?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Editor » Sat May 14, 2005 12:33 am

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).
Game Editor is great... If only I could afford the full version...
Editor
 
Posts: 20
Joined: Fri Apr 22, 2005 7:32 pm
Score: 0 Give a positive score

Postby makslane » Sat May 14, 2005 1:22 pm

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
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest