Why Does My Game Just Exit Immediatly


Geuben

Member
Joined
Sep 5, 2006
Messages
180
hey, im new to fenix, but have coded before in div and div2 (been awhile tho). the problem is i cant seem to get a little test game to run on my gp2x, i managed to get the "hello world" example running. my code is

Code:
PROGRAM test;

GLOBAL	
file1;
	
		begin
				  
		file1=load_fpg("game.fpg");
		put_screen(file1,001);	
		sqr();

		FRAME;
	
		ENd;
		
process sqr();
	BEGIN
		graph = 002; 
		x=100;
		y = 100;
		LOOP
			if(key(_right));
				x+=1;
			END
		FRAME;
		END;
	END

when i run the gpe file on my gp2x i get the splash screen then nothing until i press B then it goes straight back to the main menu. is something wrong with my code, as i said, its been awhile since i coded in this language, but it compiles and works fine on my pc, ive read the other posts with similar problems, but none of the suggested solutions have worked (replacing one of the test.dcb etc) think im using the correct compiler 0.84 (atleast it says that at the bottom of flamebird), anyone able to help, really want to get cracking with coding some games.
 
Geuben posted on Sep 4 2006 at 11:43 PM said:
hey, im new to fenix, but have coded before in div and div2 (been awhile tho). the problem is i cant seem to get a little test game to run on my gp2x, i managed to get the "hello world" example running. my code is

Code:
PROGRAM test;

GLOBAL	
file1;
	
		begin
				  
		file1=load_fpg("game.fpg");
		put_screen(file1,001);	
		sqr();

		FRAME;
	
		ENd;
		
process sqr();
	BEGIN
		graph = 002; 
		x=100;
		y = 100;
		LOOP
			if(key(_right));
				x+=1;
			END
		FRAME;
		END;
	END

when i run the gpe file on my gp2x i get the splash screen then nothing until i press B then it goes straight back to the main menu. is something wrong with my code, as i said, its been awhile since i coded in this language, but it compiles and works fine on my pc, ive read the other posts with similar problems, but none of the suggested solutions have worked (replacing one of the test.dcb etc) think im using the correct compiler 0.84 (atleast it says that at the bottom of flamebird), anyone able to help, really want to get cracking with coding some games.

; at the end of the if statement definately looks "iffy", if you'll pardon the pun lol
 
Last edited by a moderator:
and your main problem is that there is no loop in your main program loop. it will draw a single frame and exit...
 
No it won`t :blink: the sqr process is running and has a loop.

This should be the correct version to use (I hope so): 084.


You also don`t need a frame; in the program process.
 
Quiest posted on Sep 5 2006 at 04:32 PM said:
No it won`t :blink: the sqr process is running and has a loop.

This should be the correct version to use (I hope so): 084.


You also don`t need a frame; in the program process.
haven't worked in fenix in a while, but doesn't your program just stop if you reach the end of the main process?
 
Last edited by a moderator:
Back
Top