ENIGMA Forums

Sharing is caring => Tips, Tutorials, Examples => Topic started by: nbeerbower on August 18, 2008, 10:03:02 pm

Title: Alternate to game_end
Post by: nbeerbower on August 18, 2008, 10:03:02 pm
Can't end the game? Cause an error!

Here's the one I use.
Code: [Select]
point_distance(KITTYZ_ARE_CUTE,KITTYZ_ARE_CUTE,x,y)//cause an error
Causing an error that will end the game might not look too good but it's the best we're going to get in R3. :P

Title: Re: Alternate to game_end
Post by: Game_boy on August 19, 2008, 06:34:57 am
Shouldn't that have been one of the more important functions? Oh well...

point_distance(YOU,YOUR_MOM,YOUR_FACE,CHUCK_NORRIS_ROUNDHOUSE_KICK)
Title: Re: Alternate to game_end
Post by: serprex on August 19, 2008, 02:09:24 pm
Or you know, add in game_end()

First, remove char bQuit=0 in WINDOWS\WINDOWSmain.h
Then, add
Code: [Select]
char bQuit=0;int game_end(){bQuit=1;}At the top of SHELLmain.cpp
Then add int game_end() at the top of Compiler Source\fnames.txt

TADA!
Title: Re: Alternate to game_end
Post by: nbeerbower on August 19, 2008, 02:21:11 pm
They're all good ideas! :P
Title: Re: Alternate to game_end
Post by: Josh @ Dreamland on November 29, 2008, 11:44:11 pm
Practically nothing errors at runtime in ENIGMA.

If you want to end the game, say:
cpp { 1/0; }

I'll mention that game_end is implemented for next release, though.
Title: Re: Alternate to game_end
Post by: OniLink10 on November 30, 2008, 08:35:27 pm
exit(0) ends the program and tells windows that there were no errors. Any other value tells Windows that there was an error.
Title: Re: Alternate to game_end
Post by: Josh @ Dreamland on November 30, 2008, 10:30:09 pm
Ruiner of fun <_<
Title: Re: Alternate to game_end
Post by: RetroX on December 01, 2008, 05:03:57 pm
That would work better, considering that you won't end up with Windows giving you a "would you like to report this error" message.

Although I already disabled that because it pissed me off.