Commits

clach04  committed f6356a1
  • Participants
  • Parent commits 46cc32d

Comments (0)

Files changed (54)

+	
+- Alpha 3
+	Speech synthesis samples
+	More video effects
+	Hero dead
+	Added more sound effects
+	Pause screen
+	Game over screen
+	Language menu option (only screen)
+	Top records menu option (only screen)
+	Command arguments (audio/video options)
+	
 
 - Alpha 2
 	Added SFont and SDL_flic.

File Makefile.gp32

-FXE_TEXT =	"VORTON ALPHA-2"
+FXE_TEXT =	"VORTON ALPHA-3"
 FXE_COMP =	"HIGHWAY DEVS"
 FXE_ICON =	src/gp32/icon.bmp
 
 		src/pyramid.c \
 		src/dummy.c \
 		src/exit.c \
+		src/language.c \
+		src/records.c \
 		src/SDL_flic/SDL_flic.c \
 		src/SDL_flic/SDL_playflic.c \
 		src/SDL_flic/node_text.c \

File Makefile.linux

 
 
 CFLAGS =	-Wall -Wno-switch -march=pentium -mcpu=pentium -DDEBUG \
-		-DDATA_PREFIX=\"data/\" -DFILE_SEPARATOR=\"/\" \
+		-DDATA_PREFIX=\"data/\" -DFILE_SEPARATOR=\"/\" -DARGS \
 		-Isrc -Isrc/SDL_flic -Isrc/SFont `sdl-config --cflags` \
 		-ffast-math -fno-common -ffreestanding -fno-builtin \
 		-fno-exceptions -fstrict-aliasing -O6 \
 		src/pyramid.c \
 		src/dummy.c \
 		src/exit.c \
+		src/language.c \
+		src/records.c \
 		src/SDL_flic/SDL_flic.c \
 		src/SDL_flic/SDL_playflic.c \
 		src/SDL_flic/node_text.c \
 
 
 run:		$(TARGET)
-	./$(TARGET)
+	./$(TARGET) -windowscreen -nosound -8bits
 
 
 clean:

File Makefile.windows

 
 
 SDL_CFLAGS =	`sdl-config --cflags`
-SDL_LDFLAGS =	`sdl-config --static-libs`
+SDL_LDFLAGS =	`sdl-config --libs`
 
 
 CFLAGS =	-Wall -Wno-switch -march=pentium -mcpu=pentium -DDEBUG \
 		-DDATA_PREFIX=\"data/\" -DFILE_SEPARATOR=\"/\" -DWINDOWS \
-		-Isrc -Isrc/SDL_flic -Isrc/SFont ${SDL_CFLAGS} \
+		-Isrc -Isrc/SDL_flic -Isrc/SFont ${SDL_CFLAGS} -DARGS \
 		-ffast-math -fno-common -ffreestanding -fno-builtin \
 		-fno-exceptions -fstrict-aliasing -O6 -I/usr/local/include \
 
 
-LDFLAGS =	-L/usr/lib ${SDL_LDFLAGS} -lSDL_image -lSDL_mixer -lpng -lz -ljpeg \
+LDFLAGS =	-L/usr/lib ${SDL_LDFLAGS} -lSDL_image -lSDL_mixer \
+		-lpng -lz -ljpeg \
 
 
 
 		src/pyramid.c \
 		src/dummy.c \
 		src/exit.c \
+		src/language.c \
+		src/records \
 		src/SDL_flic/SDL_flic.c \
 		src/SDL_flic/SDL_playflic.c \
 		src/SDL_flic/node_text.c \
 all: $(TARGET)
 
 
+
 OBJS =		$(.CFILES:.c=.o)
 
 
 	$(STRIP) $(TARGET)
 
 
+static:	$(OBJS)
+	$(CC) -L/usr/local/lib -o $(TARGET) -lmingw32 $(OBJS) -lSDL_static -mwindows -mno-cygwin -luser32 -lgdi32 -lwinmm
+	$(STRIP) $(TARGET)
+
+
 run:		$(TARGET)
 	./$(TARGET)
 
 Please read the license file.
 
 
+Arguments:
+        -sound          Play with sound
+        -nosound        Play without sound
+        -highsound      Audio at 44100Hz
+        -lowsound       Audio at 22050Hz
+        -monosound      Mono Audio
+        -stereosound    Stereo Audio
+        -windowscreen   Windowed Video Mode
+        -fullscreen     Fullscreen Video Mode
+        -8bits          8  bits color screen
+        -16bits         16 bits color screen
+        -24bits         24 bits color screen
+        -32bits         32 bits color screen
+
+
+
 ---- Linux ----
 
 Requeriments:

File data/1/level.map

 -------------------------------------------------------------------------------------------------
 <OBJ>
 	<X 30>
-	<Y 1>
-	<MOVE 7>
-	<VEL 1>
-	<TYPE MOUTH>
-	<ITER 40>
-	<VEC_X 1>
-	<VEC_Y 1>
-	<SIGN 1>
-</OBJ>
-<OBJ>
-	<X 40>
-	<Y 1>
-	<MOVE 1>
-	<VEL 0>
-	<TYPE MOUTH>
-	<ITER 40>
-	<VEC_X 1>
-	<VEC_Y 0>
-	<SIGN 1>
-</OBJ>
-<OBJ>
-	<X 50>
-	<Y 50>
-	<MOVE 7>
-	<VEL 1>
-	<TYPE ROBOT>
-	<ITER 40>
-	<VEC_X 1>
-	<VEC_Y 0>
-	<SIGN 1>
-</OBJ>
-<OBJ>
-	<X 60>
-	<Y 1>
-	<MOVE 1>
-	<VEL 0>
-	<TYPE MOUTH>
-	<ITER 40>
-	<VEC_X 1>
-	<VEC_Y 0>
-	<SIGN 1>
-</OBJ>
-<OBJ>
-	<X 70>
-	<Y 1>
-	<MOVE 1>
-	<VEL 0>
-	<TYPE MOUTH>
-	<ITER 40>
-	<VEC_X 1>
-	<VEC_Y 0>
-	<SIGN 1>
-</OBJ>
-<OBJ>
-	<X 80>
-	<Y 1>
-	<MOVE 1>
-	<VEL 0>
-	<TYPE MOUTH>
-	<ITER 40>
-	<VEC_X 1>
-	<VEC_Y 0>
-	<SIGN 1>
-</OBJ>
-<OBJ>
-	<X 90>
-	<Y 1>
-	<MOVE 1>
-	<VEL 0>
-	<TYPE MOUTH>
-	<ITER 40>
-	<VEC_X 1>
-	<VEC_Y 0>
-	<SIGN 1>
-</OBJ>
-<OBJ>
-	<X 30>
 	<Y 40>
 	<TYPE BLOQ>
 </OBJ>

File data/1/mina0.png

Old
Old image
New
New image

File data/1/mina1.png

Old
Old image
New
New image

File data/1/mina2.png

Old
Old image
New
New image

File data/1/mina3.png

Old
Old image
New
New image

File data/1/mina4.png

Old
Old image
New
New image

File data/1/mina5.png

Old
Old image
New
New image

File data/1/mina6.png

Old
Old image
New
New image

File data/1/mina7.png

Old
Old image
New
New image

File data/common/active.wav

Binary file added.

File data/common/awesome.wav

Binary file added.

File data/common/ball.png

Old
Old image
New
New image

File data/common/bye.wav

Binary file added.

File data/common/expl.wav

Binary file added.

File data/common/expl0.png

Old
Old image
New
New image

File data/common/expl2.png

Old
Old image
New
New image

File data/common/expl4.png

Old
Old image
New
New image

File data/common/fontgame.png

Added
New image

File data/common/gameover.wav

Binary file added.

File data/common/hero0e.png

Added
New image

File data/common/hero1e.png

Added
New image

File data/common/hero2e.png

Added
New image

File data/common/hero3e.png

Added
New image

File data/common/hurry.wav

Binary file added.

File data/common/langbkgr.png

Added
New image

File data/common/pause.wav

Binary file added.

File data/common/ping.wav

Binary file added.

File data/common/ready.wav

Binary file added.

File data/common/recordb0.png

Added
New image

File data/common/recordb1.png

Added
New image

File data/common/recordbg.png

Added
New image

File data/common/star.png

Added
New image

File data/common/thrust.wav

Binary file added.

File data/common/welcome.wav

Binary file added.

File src/SDL_flic/SDL_playflic.c

 
 int FLI_Play(SDL_Surface *screen, SDL_Rect *pos, char *flic_name, int mem, char *music_name, SDL_Surface *font, char *text, int loop)
 {
-	SDL_RWops     *rwops=NULL;
-	void	      *buffer=NULL;
-	FLI_Animation *flic;
-	Mix_Music     *music=NULL;
-	int	      error;
-	SDL_Rect      tmp_pos;
-	SDL_Event     event;
-	Uint32	      ticks;
-	char	*actual_text=NULL;
-	Uint32	actual_frame=0;
-	int	font_h=0;
+	SDL_RWops	*rwops=NULL;
+	void		*buffer=NULL;
+	FLI_Animation	*flic;
+	Mix_Music	*music=NULL;
+	int		error;
+	SDL_Rect	tmp_pos;
+	SDL_Event	event;
+	Uint32		ticks;
+	char		*actual_text=NULL;
+	Uint32		actual_frame=0;
+	int		font_y,font_h=0;
+#ifndef GP32
+	int		need_erase=0;
+#endif
 
 	// Open the flic. 
 	if (mem)
 		goto out;
 	}
 	// Play the flic. 
-	tmp_pos.x = tmp_pos.y = 0;
+	tmp_pos.x = (screen->w-flic->width)>>1;
+	tmp_pos.y = (screen->h-flic->height)>>1;
 	if (pos==NULL)
 		pos=&tmp_pos;
+	font_y= screen->h - pos->y - font_h;
+#ifndef GP32
+	if ((pos->x>0)||(pos->y>0))
+		need_erase=-1;
+#endif
 	if (music_name != NULL)
 		music = Mix_LoadMUS(music_name);
 	if (music != NULL)
 		error = FLI_NextFrame(flic);
 		if (error != FLI_OK)
 			goto out;
+#ifndef GP32
+		if (need_erase)
+			SDL_FillRect(screen,NULL,0);
+#endif
 		// Blit it.
 		SDL_BlitSurface(flic->surface, NULL, screen, pos);
 		if (actual_text!=NULL)
-			SFont_XCenteredString(screen,screen->h-font_h,actual_text);
+			SFont_XCenteredString(screen,font_y,actual_text);
 		SDL_Flip(screen);
 		// Exit program in case of any event.
 		while (SDL_PollEvent(&event) == 1) {
 	DATA_COMMON "laser.wav",
 	DATA_COMMON "hit.wav",
 	DATA_COMMON "blow.wav",
+	DATA_COMMON "expl.wav",
+	DATA_COMMON "active.wav",
+	DATA_COMMON "thrust.wav",
+	DATA_COMMON "welcome.wav",
+	DATA_COMMON "bye.wav",
+	DATA_COMMON "awesome.wav",
+	DATA_COMMON "gameover.wav",
+	DATA_COMMON "hurry.wav",
+	DATA_COMMON "pause.wav",
+	DATA_COMMON "ready.wav",
+	DATA_COMMON "ping.wav",
 };
 
 Mix_Music *music[NUM_MUSICS];
 void music_stop(void)
 {
 #ifndef NOSOUND
+#ifdef ARGS
+	if (sound_arg)
+	{
+#endif
 	while (Mix_PlayingMusic())
 	{
 		Mix_HaltMusic();
 
-		SDL_Delay(300);
+		SDL_Delay(100);
 	}
+#ifdef ARGS
+	}
+#endif
+#endif
+}
+
+void music_stop_fade(void)
+{
+#ifndef NOSOUND
+#ifdef ARGS
+	if (sound_arg)
+	{
+#endif
+		Mix_FadeOutMusic(3000);
+#ifdef ARGS
+	}
+#endif
 #endif
 }
 
 void music_play(int n_music)
 {
 #ifndef NOSOUND
-	music_stop();
-	Mix_PlayMusic(music[n_music],-1);
+#ifdef ARGS
+	if (sound_arg)
+	{
+#endif
+		music_stop();
+		Mix_PlayMusic(music[n_music],-1);
+#ifdef ARGS
+	}
+#endif
 #endif
 }
 
+void music_play_fade(int n_music)
+{
+#ifndef NOSOUND
+#ifdef ARGS
+	if (sound_arg)
+	{
+#endif
+		music_stop();
+		Mix_FadeInMusic(music[n_music],-1,2000);
+#ifdef ARGS
+	}
+#endif
+#endif
+}
+
+
 void play_sound(int n_sound)
 {
 #ifndef NOSOUND
-	Mix_PlayChannel(-1, sound[n_sound],0);
+#ifdef ARGS
+	if (sound_arg)
+	{
+#endif
+		Mix_PlayChannel(-1, sound[n_sound],0);
+#ifdef ARGS
+	}
+#endif
 #endif
 }
+
+void play_thrust(void)
+{
+#ifndef NOSOUND
+#ifdef ARGS
+	if (sound_arg)
+	{
+#endif
+//		Mix_PlayChannel(0, sound[SND_THRUST],-1);
+		Mix_FadeInChannel(1, sound[SND_THRUST],-1,1000);
+#ifdef ARGS
+	}
+#endif
+#endif
+}
+
+void stop_thrust(void)
+{
+#ifndef NOSOUND
+#ifdef ARGS
+	if (sound_arg)
+	{
+#endif
+	Mix_FadeOutChannel(1,1000);
+#ifdef ARGS
+	}
+#endif
+#endif
+}
+
+void music_up(void)
+{
+#ifndef NOSOUND
+#ifdef ARGS
+	if (sound_arg)
+	{
+#endif
+	Mix_VolumeMusic(128);
+#ifdef ARGS
+	}
+#endif
+#endif
+}
+
+void music_down(void)
+{
+#ifndef NOSOUND
+#ifdef ARGS
+	if (sound_arg)
+	{
+#endif
+	Mix_VolumeMusic(96);
+#ifdef ARGS
+	}
+#endif
+#endif
+}
+
+#define WAIT_TIME_OUT 100
+
+void wait_channels(void)
+{
+#ifndef NOSOUND
+	int i,j;
+#ifdef ARGS
+	if (sound_arg)
+	{
+#endif
+		for(i=0,j=0;i<4;i++,j=0)
+			while((Mix_Playing(i)&&(j<WAIT_TIME_OUT)))
+				SDL_Delay(100);
+#ifdef ARGS
+	}
+#endif
+#endif
+}
 	this->size_y=TILE_SIZE;
 	this->process=(void *)&dummy_process;
 	this->collision=(void *)&dummy_collision;
+	this->state=8;
 }
 
  */
 #include "vorton.h"
 
-extern SDL_Surface *screen;
-extern SDL_Surface *image[NUM_IMAGES];
-
 #define MAX_MSG 64
 #define MIN_SCROLL (-(MAX_MSG*32))
 
 	int ret=0;
 	SDL_Event event;
 	
-            /* Poll for events */
-            while( SDL_PollEvent( &event ) ){/*0*/
-                switch( event.type ){ /*1*/
-                    /* Keyboard event */
-                   
-                    case SDL_KEYDOWN:
-		    case SDL_QUIT:
-                        ret = 1;
-                        break;
+	/* Poll for events */
+	while( SDL_PollEvent( &event ) )
+	{
+		switch( event.type )
+		{
+			/* Keyboard event */
+			case SDL_KEYDOWN:
+			case SDL_QUIT:
+				music_down();
+				music_stop_fade();
+				play_sound(SND_BYE);
+				ret = -1;
+			break;
+			default:
+		} 
+	}
 
-                    default:
-                        break;
-                } /*1*/
-            } /*0*/
-
-	  return ret;
+	return ret;
 }	
 
 void exit_game(void)
 			x=0;
 
 	}
-	music_stop();
+	wait_channels();
 }
 
 static int hero_hiting=0;
 
+
+void hero_init(int x, int y, int state)
+{
+	hero.x=x;
+	hero.y=y;
+	hero.back_x=x;
+	hero.back_y=y;
+	hero.push_x=0;
+	hero.push_y=0;
+	hero.state=state;
+	hero.rot=6;
+	hero.vel=0;
+	hero.obj_type=TYPE_HERO;
+	hero.img=IMG_HERO_0_1;
+	hero.process=(void *)&hero_process;
+	hero.collision=(void *)&hero_collision;
+	hero.size_x=TILE_SIZE;
+	hero.size_y=TILE_SIZE;
+}
+
 /*
   FUNCION: hero_process
 	Proceso del heroe.
 	{
 		hero_hiting++;
 		if (hero_hiting>9)
-			hero_hiting=0;
+		{
+			if (!hero.state)
+			{
+				int i,o=0;
+				hero.rot=0;
+				switch(hero_hiting)
+				{
+					case 10:
+						play_sound(SND_EXPL);
+					case 11:
+					case 12:
+					case 13:
+					case 14:
+						hero.img=IMG_HERO_HIT_0;
+						break;
+					case 15:
+					case 16:
+					case 17:
+					case 18:
+					case 19:
+						hero.img=IMG_HERO_HIT_1;
+						break;
+					case 20:
+					case 21:
+					case 22:
+					case 23:
+					case 24:
+						hero.img=IMG_HERO_HIT_2;
+						SDL_Delay(10);
+						init_frame_time();
+						break;
+					case 25:
+					case 26:
+					case 27:
+					case 28:
+					case 29:
+						hero.img=IMG_HERO_HIT_3;
+						break;
+					case 30:
+					case 31:
+					case 32:
+					case 33:
+					case 34:
+						hero.img=IMG_EXPL2;
+						break;
+					case 35:
+					case 36:
+					case 37:
+					case 38:
+					case 39:
+						hero.img=IMG_EXPL1;
+						break;
+					case 40:
+					case 41:
+					case 42:
+					case 43:
+					case 44:
+						hero.img=IMG_EXPL4;
+						break;
+					case 45:
+					case 46:
+					case 47:
+					case 48:
+					case 49:
+						hero.img=IMG_EXPL0;
+						break;
+					default:
+						for(i=0;i<MAX_OBJ;i++)
+							if (obj[i].obj_type==TYPE_DUMMY)
+								o=i;
+							else
+							if (obj[i].obj_type>TYPE_DUMMY)
+								break;
+						if (o)
+						{
+							hero_init(obj[o].x,obj[o].y,obj[o].state);
+							free_obj(o);
+							global_pos=hero.y;
+							play_sound(SND_ACTIVE);
+						}
+						else
+						{
+							theend=-1;
+						}
+						hero_hiting=0;
+				}
+			}
+			else
+				hero_hiting=0;
+		}
 		else
-			hero.rot=(hero.rot+2)%8;
+			hero.rot=(hero.rot+1)%8;
 	}
 }
 
 #include "vorton.h"
 #include <SDL/SDL.h>
 
-#define ANCHO 160
-#define ALTO 144
+#ifdef GP32
+#define WIDTH 160
+#define HEIGHT 144
 #define BITS 16
 #define RATE 22050
 #define AUDIOBUF 256
+#else
+#define WIDTH 320
+#define HEIGHT 240 
+#define RATE 44100
+#ifdef WINDOWS
+#define AUDIOBUF 2048
+#else
+#define AUDIOBUF 512
+#endif
+#define BITS 16
+#endif
+
 #define FLCFILE DATA_COMMON "intro.flc"
 #define MODFILE DATA_COMMON "intro.mod"
 #define TEXTFILE DATA_COMMON "intro.txt"
 
 void intro (void)
 {
-	SDL_Surface *screen=SDL_SetVideoMode(ANCHO,ALTO,BITS,SDL_HWSURFACE|SDL_DOUBLEBUF | SDL_FULLSCREEN);
+	SDL_Surface *screen;
+	Uint32 video_args=SDL_HWSURFACE|SDL_DOUBLEBUF;
+	int bits=BITS;
+
+#ifdef ARGS
+	if (fullscreen_arg)
+		video_args|=SDL_FULLSCREEN;
+	bits=bitscolor_arg;
+#endif
+	
+	screen=SDL_SetVideoMode(WIDTH,HEIGHT,BITS,video_args);
 	if (screen!=NULL)
 	{
 		SDL_ShowCursor(SDL_DISABLE);
 #ifndef NOSOUND
-		FLI_Play(screen, NULL, FLCFILE, -1, MODFILE, NULL,  TEXTFILE, 1);
+#ifdef ARGS
+SDL_Delay(2000);
+		if (!sound_arg)
+			FLI_Play(screen, NULL, FLCFILE, -1, NULL, NULL, TEXTFILE, 1);
+		else
+#endif
+			FLI_Play(screen, NULL, FLCFILE, -1, MODFILE, NULL,  TEXTFILE, 1);
 #else
 		FLI_Play(screen, NULL, FLCFILE, -1, NULL, NULL, TEXTFILE, 1);
 #endif

File src/language.c

+/*
+ * Vorton - Highway Encounter SDL Remake Game.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#include "vorton.h"
+
+#define MAX_LANG 5
+
+static char *langs[MAX_LANG]={ "English", "Espa�ol", "Deutsch", "Fran�ais", "Italiano" };
+
+static inline void show(void)
+{
+	int i,x,y;
+
+	for (i=1;i<=40;i++)
+	{
+		for(y=0;y<6;y++)
+			for(x=0;x<8;x++)
+			{
+				SDL_Rect r;
+				r.x=160 + (i*(x-4));
+				r.y=120 + (i*(y-3));
+				r.h=40;
+				r.w=40;
+
+				SDL_BlitSurface(image[IMG_LANGUAGE_BACKGROUND],NULL,screen,&r);
+			}
+		SDL_Flip(screen);
+#ifndef GP32
+		SDL_Delay(10);
+#endif
+	}
+
+}
+
+static inline void draw_lang(void)
+{
+	int x,y;
+
+	for(y=0;y<6;y++)
+		for(x=0;x<8;x++)
+		{
+			SDL_Rect r;
+			r.x=x*40;
+			r.y=y*40;
+			r.h=40;
+			r.w=40;
+
+			SDL_BlitSurface(image[IMG_LANGUAGE_BACKGROUND],NULL,screen,&r);
+		}
+	for(x=0;x<MAX_LANG;x++)
+	{
+		SFont_XCenteredString(screen,(120/MAX_LANG)+x*(240/(MAX_LANG+1)),langs[x]);
+	}
+	SDL_Flip(screen);
+}
+
+void language(void)
+{
+	show();
+	draw_lang();
+	SDL_Delay(2000);
+}
 			other->process=(void *)&expl_process;
 			play_sound(SND_HIT);
 			other->rot=0;
+			other->obj_type=TYPE_EXPL;
 			other->img=IMG_EXPL0;  /* Le cambio la imagen */
 			free_laser(this->position); /* Elimina disparo */
 			break;
 	0x78, 0x7A, 0x7C, 0x7E, 0x80, 0x83, 0x85, 0x87
 };
 
-extern SDL_Surface *screen;
-extern SDL_Surface *image[NUM_IMAGES];
-
 static inline int WaitKey(int *option)
 {
 	int ret=0;
 					    ret=1;
 					    break;
 				    case SDLK_UP:
+					    play_sound(SND_PING);
 					    if (*option)
 					    	*option=(*option)-1;
 					    else
 						*option=4;
 					    break;
 				    case SDLK_DOWN:
+					    play_sound(SND_PING);
 					    *option=((*option)+1)%5;
 					    break;
 			    }
 }
 
 
-int selection(void)
+int selection(int mus)
 {
 	int option=0;
 	int i=3, vel=4, spin=1, spin_offset=1;
 	int x2,y2;
 
 	SFont_InitFont(image[IMG_FONT_OPTIONS]);
-	music_play(MUSIC_MENU);
+	if (!mus)
+		music_play_fade(MUSIC_MENU);
 	x2=screen->w/2;
 	y2=screen->h/2;
 	for(x=1;x<=x2;x+=8)
 		draw_options(option);
 		SDL_Flip(screen);
 #ifndef GP32
-		SDL_Delay(10);
+		SDL_Delay(20);
 #endif
 	}
-	if (option!=4)
+	if (option==1)
 		music_stop();
 	do
 		SDL_Delay(100);

File src/process.c

 			switch(key)
 			{
 				case SDLK_RETURN:
-theend=-1;
-						return_pressed=set; break;
+						pauseScreen();
+						break;
 				case SDLK_SPACE:
 						space_pressed=set; break;
 				case SDLK_RIGHT:
 						up_pressed=set; break;
 				case SDLK_DOWN:
 						down_pressed=set; break;
+#ifdef GP32
 				case SDLK_TAB:
-						tab_pressed=set; break;
+#else
+				case SDLK_ESCAPE:
+#endif
+						theend=-1; break;
 				case SDLK_BACKSPACE:
 						backspace_pressed=set; break;
 				case SDLK_LCTRL:
 		game_time--;
 		if (game_time<0)
 			theend=1;
+		else if (game_time<20)
+		{
+			if ((game_time==19)||(game_time==10)||(game_time==5))
+			{
+				music_down();
+				play_sound(SND_HURRY);
+				video_msg="A PRISA !";
+			}
+			else
+			{
+				music_up();
+				video_msg=NULL;
+			}
+		}
 	}
 }
 
 	int i;
 
 	/* Inicia el Objeto heroe */
-	hero.x=64;
-	hero.y=20;
-	hero.back_x=64;
-	hero.back_y=10;
-	hero.push_x=0;
-	hero.push_y=0;
-	hero.state=8;
-	hero.rot=6;
-	hero.vel=0;
-	hero.obj_type=TYPE_HERO;
-	hero.img=IMG_HERO_0_1;
-	hero.process=(void *)&hero_process;
-	hero.collision=(void *)&hero_collision;
-	hero.size_x=TILE_SIZE;
-	hero.size_y=TILE_SIZE;
+	hero_init(64,20,8);
 
+	game_time=100;
 	lasers=0;
 	spin_laser=0;
 
 	int i;
 
 	global_pos=60;
-	ship_x=-200;
-	ship_y=-40;
 	for(i=0;i<=lives;i++)
 	{
 		obj[i].x=-2000;
 	hero.x=-2000;
 	hero.y=-2000;
 
+	SFont_InitFont(image[IMG_FONT_GAME]);
 	next_time=SDL_GetTicks()+FPS;
+	ship_x=-2000;
+	ship_y=-2000;
+	for(i=0;i<60;i++)
+	{
+#ifndef GP32
+		if (isframe())
+#endif
+			draw_init_level_presentation(i, "PREPARADO");
+	}
+	for(i=0;i<25;i++)
+	{
+#ifndef GP32
+		if (isframe())
+#endif
+			draw_init_level_presentation(59,"PREPARADO");
+	}
+	ship_x=-200;
+	ship_y=-40;
+	play_thrust();
 	for(i=0;i<100;i++)
 	{
 #ifndef GP32
 			}
 		}
 	}
+	stop_thrust();
+	play_sound(SND_ACTIVE);
 	hero.rot=6;
 	hero.vel=2;
 }
 
-
+void init_frame_time(void)
+{
+	next_time=SDL_GetTicks()+FPS;
+}
 
 /*
   FUNCION: process
 */
 void process()
 {
-	music_play(MUSIC_LEVEL);
+	int i;
+
+	play_sound(SND_READY);
+	music_play_fade(MUSIC_LEVEL);
 	init_level();
-	next_time=SDL_GetTicks()+FPS;
+	init_frame_time();
 	theend=0;
 	while(!theend)
 	{
 		real_process();
 		calcule_time();
 	}
+
+	music_stop_fade();
+	SFont_InitFont(image[IMG_FONT_GAME]);
+	for(i=59;i>=0;i--)
+	{
+#ifndef GP32
+		if (isframe())
+#endif
+			draw_init_level_presentation(i, "FIN DEL JUEGO");
+		if (i==40)
+			play_sound(SND_GAMEOVER);
+	}
+	SDL_Delay(1500);
 	music_stop();
 }
 

File src/records.c

+/*
+ * Vorton - Highway Encounter SDL Remake Game.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#include "vorton.h"
+
+#define MAX_RECORDS 5
+
+static char *record[MAX_RECORDS]={ "JUAN", "PEPE", "PEDRO", "LUIS", "DAVID" };
+
+
+static inline void show(void)
+{
+	int i,j,k;
+	Uint8 *buf8=(Uint8 *)screen->pixels;
+	Uint16 *buf16=(Uint16 *)screen->pixels;
+	Uint32 *buf32=(Uint32 *)screen->pixels;
+
+	for(k=0;k<3;k++)
+		for(i=63;i>1;i-=3)
+		{
+			switch(screen->format->BitsPerPixel)
+			{
+				case 8:
+					for(j=k;j<320*240;j+=i)
+						buf8[j]=0;
+					break;
+				case 16:
+					for(j=k;j<320*240;j+=i)
+						buf16[j]=0;
+					break;
+				case 32:
+					for(j=k;j<320*240;j+=i)
+						buf32[j]=0;
+					break;
+			}
+			SDL_Flip(screen);
+#ifndef GP32
+			SDL_Delay(10);
+#endif
+		}
+			
+}
+
+
+star_x[32]={
+	271, 159, 316, 183, 131, 247, 135, 159, 71, 159, 159, 103, 159, 159,
+	235, 174, 234, 159, 19, 257, 258, 304, 117, 249, 175, 269, 2, 159,
+	139, 135, 270, 158  };
+
+star_y[32]={
+	87, 71, 119, 215, 147, 75, 115, 119, 229, 206, 119, 231, 109, 11, 214,
+	209, 119, 179, 119, 217, 152, 177, 119, 179, 159, 174, 119, 191, 114,
+	125, 230, 121  };
+
+star_ax[32]={
+	7, 1, 1, 1, -1, 4, -6, 1, -4, 1, 1, -2, 0, 0, 4, 1, 3, 1, -4, 7, 3, 5,
+	-3, 6, 2, 2, -1, 1, -4, -4, 3, -1,  };
+
+star_ay[32]={
+	-2, -3, 0, 4, 1, -2, -1, 0, 5, 1, 0, 4, -1, -3, 5, 6, 0, 5, 0, 7, 1, 2,
+	0, 4, 5, 1, 0, 1, -1, 1, 3, 2,  };
+
+
+static inline void draw_stars(void)
+{
+	int i;
+	SDL_Rect r;
+
+	r.h=3;
+	r.w=3;
+
+	for(i=0;i<32;i++)
+	{
+		star_x[i]+=star_ax[i];
+		star_y[i]+=star_ay[i];
+		if ((star_x[i]<0)||(star_x[i]>320)||(star_y[i]<0)||(star_y[i]>240))
+		{
+			star_x[i]=159;
+			star_y[i]=119;
+			register int ax=(rand()&0x7);
+			register int ay=(rand()&0x7);
+
+			if (!ax && !ay)
+				star_ax[i]=-5000;
+			else
+			switch(rand()&0x3)
+			{
+				case 0:
+					star_ax[i]=ax;
+					star_ay[i]=ay;
+					break;
+				case 1:
+					star_ax[i]=-ax;
+					star_ay[i]=ay;
+					break;
+				case 2:
+					star_ax[i]=ax;
+					star_ay[i]=-ay;
+					break;
+				default:
+					star_ax[i]=-ax;
+					star_ay[i]=-ay;
+					break;
+			}
+		}
+		else
+		{
+			r.x=star_x[i];
+			r.y=star_y[i];
+			SDL_BlitSurface(image[IMG_STAR],NULL,screen,&r);
+		}
+	}
+}
+
+static inline void draw_records(void)
+{
+	int x,y;
+	SDL_Rect r;
+
+	for(y=0;y<6;y++)
+		for(x=0;x<8;x++)
+		{
+			r.x=x*40;
+			r.y=y*40;
+			r.h=40;
+			r.w=40;
+			SDL_BlitSurface(image[IMG_RECORDS_BACKGROUND_0],NULL,screen,&r);
+		}
+
+	for(y=0;y<6;y++)
+	{
+			r.x=y*53;
+			r.y=y*40;
+			r.h=40;
+			r.w=40;
+			SDL_BlitSurface(image[IMG_RECORDS_BACKGROUND_0],NULL,screen,&r);
+			r.x=267-r.x;
+			SDL_BlitSurface(image[IMG_RECORDS_BACKGROUND_0],NULL,screen,&r);
+			r.x=100+(y<<4);
+			SDL_BlitSurface(image[IMG_RECORDS_BACKGROUND_0],NULL,screen,&r);
+			r.x=267-r.x;
+			SDL_BlitSurface(image[IMG_RECORDS_BACKGROUND_0],NULL,screen,&r);
+	}
+
+	r.x=174;
+	r.y=32;
+	r.h=40;
+	r.w=40;
+	SDL_BlitSurface(image[IMG_RECORDS_BACKGROUND_1],NULL,screen,&r);
+
+	draw_stars();
+
+	for(x=0;x<MAX_RECORDS;x++)
+	{
+		SFont_PutString(screen,10,(120/MAX_RECORDS)+x*(240/(MAX_RECORDS+1)),record[x]);
+		SFont_PutString(screen,220,(120/MAX_RECORDS)+x*(240/(MAX_RECORDS+1)),"1000");
+	}
+
+	SDL_Flip(screen);
+
+}
+
+void records(void)
+{
+	SDL_Event event;
+
+	srand(SDL_GetTicks());
+	SFont_InitFont(image[IMG_FONT_GAME]);
+	show();
+	draw_records();
+	while(SDL_PollEvent(&event)>0);
+	while(!SDL_PollEvent(&event))
+	{
+		draw_records();
+#ifndef GP32
+		SDL_Delay(30);
+#else
+		SDL_Delay(10);
+#endif
+	}
+	SFont_InitFont(image[IMG_FONT_OPTIONS]);
+
+
+}
 
 void expl_process(object *this)
 {  /* Begin expl_process */
-
-	this->rot++;	/* Aumentamos la fase de animaci�n */
+	if (!(frame%3))
+		this->rot++;	/* Aumentamos la fase de animaci�n */
 	if (this->rot==MAX_ANIM)
 	{
 		 this->rot=0;		    /* Limpiar valores temporales */
 char *image_names[NUM_IMAGES]={
 	"logo.png",
 	"menu.png",
+	"star.png",
+	"recordb0.png",
+	"recordb1.png",
+	"langbkgr.png",
 	"hero00.png",
 	"hero10.png",
 	"hero20.png",
 	"hero52.png",
 	"hero62.png",
 	"hero72.png",
+	"hero0e.png",
+	"hero1e.png",
+	"hero2e.png",
+	"hero3e.png",
 	"dummy0.png",
 	"dummy1.png",
 	"dummy2.png",
 	"energy7.png",
 	"energy8.png",
 	"font_opt.png",
+	"fontgame.png",
 	"pyramid0.png",
 	"pyramid1.png",
 	"pyramid2.png",
 	"floor7.png",
 };
 
-
 #define FL0 IMG_FLOOR_0
 #define FL1 IMG_FLOOR_1
 #define FL2 IMG_FLOOR_2
 	FL0,FL1,FL0,FL1,FL1,FL0,FL0,FL1,FL0
 };
 
+static unsigned char precal_presentation[60]=
+        {
+		0x01, 0x04, 0x07, 0x0A, 0x0E, 0x11, 0x14, 0x17, 0x1A, 0x1D,
+		0x20, 0x23, 0x26, 0x29, 0x2C, 0x2F, 0x32, 0x35, 0x37, 0x3A,
+		0x3D, 0x40, 0x42, 0x45, 0x47, 0x4A, 0x4C, 0x4F, 0x51, 0x53,
+		0x56, 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x63, 0x65, 0x67,
+		0x68, 0x6A, 0x6B, 0x6C, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73,
+		0x74, 0x74, 0x75, 0x75, 0x76, 0x76, 0x77, 0x77, 0x77, 0x77,
+        };
+
 
 /* Superficies */
 SDL_Surface *screen, *image[NUM_IMAGES];
 object *first;
 
 static char* loading_string="Loading";
+char *video_msg=NULL;
 
 void display_gauge(int i, int max, char *cad)
 {
 		SDL_FreeSurface(tmp);
 
 		/* Se establece el color transparente negro (RGB:0,0,0 = 0) */
-		if ((i>IMG_MENU)&&(i<IMG_FLOOR_0))
+		if ((i>IMG_LANGUAGE_BACKGROUND)&&(i<IMG_FLOOR_0))
 			SDL_SetColorKey(image[i],SDL_SRCCOLORKEY | SDL_RLEACCEL, 0);
 
 	}	
 */
 int video_init(void)
 {
+	int video_flags=SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWPALETTE;
+#ifdef ARGS
+	if (fullscreen_arg)
+		video_flags|=SDL_FULLSCREEN;
+#endif
 	/* Modo grafico a 320x240 con profundidad de 8bits */
 	/* Flags: DoubleBuffer, Superficie Hardware y Paleta Hardware */
+	screen=SDL_SetVideoMode(320, 240,
 #ifdef GP32
-	screen=SDL_SetVideoMode(320, 240, 8, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWPALETTE);
+				8,
 #else
-	screen=SDL_SetVideoMode(320, 240, 16, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWPALETTE | SDL_FULLSCREEN);
+#ifdef ARGS
+				bitscolor_arg,
+#else
+				16,
 #endif
+#endif
+				video_flags
+				);
 	if (screen==NULL)
 		return 0;
+	SDL_WM_SetCaption("Vorton " VORTON_VERSION, NULL);
+	SDL_ShowCursor(SDL_DISABLE);
 	/* Se cargan las imagenes */
 	return load_images();
 }
 	/* Se establece x e y iniciales del bucle */
 	s.x=floors_offset<<1;	/* Rotar a la derecha es igual que multiplicar por dos pero mas rapido */
 	d.y=floors_offset-32;
-
+	
 	/* Bucle: Se pinta los bloques del suelo */
 	for(i=0;i<10;i++)
 	{
 	draw_energy();
 	draw_score();
 	draw_time();
+	if (video_msg)
+		SFont_XCenteredString(screen,100,video_msg);
 	SDL_Flip(screen);
 }
 
 }
 
 
-void draw_init_level(void)
+static inline void draw_init_level_real(void)
 {
 	draw_floor();
 	real_draw_init_level();
 	draw_obj();
 	draw_ship();
+}
+
+void draw_init_level(void)
+{
+	draw_init_level_real();
 	SDL_Flip(screen);
 }
 
+void draw_init_level_presentation(int y, char *str)
+{
+	draw_init_level_real();
+	int h = screen->h;
+	int yy = precal_presentation[y];
+
+	if (yy<h)
+	{
+		int pitch = screen->pitch;
+		void *src = screen->pixels + (yy * pitch) + yy;
+		void *dest= src + pitch;
+		int i, many=pitch-(yy<<1);
+
+		for(i=yy+1,h-=yy;i<h;i++,dest+=pitch)
+			memcpy(dest,src,many);
+	}
+	SFont_XCenteredString(screen,100,str);
+	SDL_Flip(screen);
+}
+
+void pauseScreen(void)
+{
+	int i,j;
+	Uint32 col=SDL_MapRGB(screen->format,128,128,128);
+	Uint8 *buf8=(Uint8 *)screen->pixels;;
+	Uint16 *buf16=(Uint16 *)screen->pixels;
+	Uint32 *buf32=(Uint32 *)screen->pixels;
+	SDL_Event event;
+
+	music_down();
+	play_sound(SND_PAUSE);
+
+	switch(screen->format->BitsPerPixel)
+	{
+		case 8:
+			for(i=0;i<240;i+=2)
+				for(j=0;j<320;j+=2)
+				{
+					buf8[j+i*320]=(Uint8)col;
+					buf8[1+j+(i+1)*320]=(Uint8)col;
+				}
+			break;
+		case 16:
+			for(i=0;i<240;i+=2)
+				for(j=0;j<320;j+=2)
+				{
+					buf16[j+i*320]=(Uint16)col;
+					buf16[1+j+(i+1)*320]=(Uint16)col;
+				}
+			break;
+		case 32:
+			for(i=0;i<240;i+=2)
+				for(j=0;j<320;j+=2)
+				{
+					buf32[j+i*320]=(Uint32)col;
+					buf32[1+j+(i+1)*320]=(Uint32)col;
+				}
+			break;
+	}
+	SFont_XCenteredString(screen,100,"PAUSA");
+	SDL_Flip(screen);
+	SDL_Delay(200);
+	while (SDL_PollEvent(&event)>0)
+	{
+		if (event.type == SDL_QUIT)
+		{
+			theend=1;
+			break;
+		}
+		SDL_Delay(10);
+	}
+	if (!theend)
+	{
+		while (!SDL_PollEvent(&event))
+			SDL_Delay(100);
+		do{
+			if (event.type == SDL_QUIT)
+			{
+				theend=1;
+				break;
+			}
+			if (event.type == SDL_KEYDOWN)
+			{
+				if (event.key.keysym.sym!=SDLK_RETURN)
+					break;
+			}
+			else
+			if (event.type == SDL_KEYUP)
+				if (event.key.keysym.sym==SDLK_RETURN)
+					break;
+			SDL_Delay(100);
+		}while (SDL_PollEvent(&event)>=0);
+	}
+	music_up();
+	init_frame_time();
+}

File src/vorton.c

 
 static int level_loaded=0;
 
+
+#ifdef ARGS
+
+/*Argumento Sonido*/
+int sound_arg=1;
+
+/* Argumento Fullscreen */
+int fullscreen_arg=1;
+
+/* Argumento bitscolor */
+int bitscolor_arg=16;
+
+/* Argumento mono */
+int monosound_arg=0;
+
+/* Argumento_lowsound */
+int lowsound_arg=0;
+
+void parse_args(int n_arg, char **argv)
+{
+	int i;
+	for(i=1;i<n_arg;i++)
+		if (!strcmp(argv[i],"-sound"))
+			sound_arg=1;
+		else
+		if (!strcmp(argv[i],"-nosound"))
+			sound_arg=0;
+		else
+		if (!strcmp(argv[i],"-highsound"))
+			lowsound_arg=0;
+		else
+		if (!strcmp(argv[i],"-lowsound"))
+			lowsound_arg=1;
+		else
+		if (!strcmp(argv[i],"-monosound"))
+			monosound_arg=1;
+		else
+		if (!strcmp(argv[i],"-stereosound"))
+			monosound_arg=0;
+		else
+		if (!strcmp(argv[i],"-windowscreen"))
+			fullscreen_arg=0;
+		else
+		if (!strcmp(argv[i],"-fullscreen"))
+			fullscreen_arg=1;
+		else
+		if (!strcmp(argv[i],"-8bits"))
+			bitscolor_arg=8;
+		else
+		if (!strcmp(argv[i],"-16bits"))
+			bitscolor_arg=16;
+		else
+		if (!strcmp(argv[i],"-24bits"))
+			bitscolor_arg=24;
+		else
+		if (!strcmp(argv[i],"-32bits"))
+			bitscolor_arg=32;
+		else
+		{
+			printf("\nVorton %s version.\n\t\t\t\t\t\t\tHighway Devs. 2004.\n\n\t-sound\t\tPlay with sound\n\t-nosound\tPlay without sound\n\t-highsound\tAudio at 44100Hz\n\t-lowsound\tAudio at 22050Hz\n\t-monosound\tMono Audio\n\t-stereosound\tStereo Audio\n\t-windowscreen\tWindowed Video Mode\n\t-fullscreen\tFullscreen Video Mode\n\t-8bits\t\t8  bits color screen\n\t-16bits\t\t16 bits color screen\n\t-24bits\t\t24 bits color screen\n\t-32bits\t\t32 bits color screen\n\n\nThis game is free software; you can redistribute it and/or modify it under\nthe terms of the GNU General Public License as published by the Free Software\nFoundation; either version 2 of the License, or (at your option) any later\nversion.  To view the licence online, go to:\n\t\t\t\t\thttp://www.gnu.org/copyleft/gpl.html \n",VORTON_VERSION);
+			exit(0);
+		}
+}
+#endif
+
+
 /*
   FUNCION: init
 	Iniciacion del juego
 	level_loaded=0;
 	if (!video_init())
 		return 0;
+#ifdef ARGS
+	if (sound_arg)
+#endif
 #ifndef NOSOUND
-	if (!audio_init())
-		return 0;
+		if (!audio_init())
+			return 0;
 #endif
 	level=1;
 	return -1;
 	level=l;
 	if (!load_images())
 		return 0;
+#ifdef ARGS
+	if (sound_arg)
+#endif
 #ifndef NOSOUND
-	if (!load_musics())
-		return 0;
+		if (!load_musics())
+			return 0;
 #endif
 	return -1;
 }
 
 void intro (void);
-int selection (void);
+int selection (int mus);
 void exit_game(void);
 
 static inline int new_game(void)
 	process();
 }
 
-static inline void language(void)
-{
-	process();
-}
-
-static inline void records(void)
-{
-	process();
-}
-
 /*
   FUNCION: quit
 	Finalizacion del juego
 #endif
 {
 
-	int exit_main_loop=0;
+	int exit_main_loop=0, rate=RATE, mus=0;
+#ifdef ARGS
+	Uint32 sdl_arg=SDL_INIT_VIDEO;
+	parse_args(n_arg,argv);
 
+	if (sound_arg)
+		sdl_arg|=SDL_INIT_AUDIO;
+	if (SDL_Init(sdl_arg))
+#else
 	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO))
+#endif
 	{
 #ifndef GP32
 		printf("SDL not open: %s\n",SDL_GetError());
 #endif
 	}
 #ifndef NOSOUND
-	if (Mix_OpenAudio(RATE, AUDIO_S16, 2, AUDIOBUF))
-	{
+#ifdef ARGS
+	if (lowsound_arg)
+		rate=22050;
+	if (sound_arg)
+#endif
+		if (Mix_OpenAudio(rate, AUDIO_S16, 2, AUDIOBUF))
+		{
 #ifndef GP32
-		printf("Mixer not open: %s\n",SDL_GetError());
-		return -2;
+			printf("Mixer not open: %s\n",SDL_GetError());
+			return -2;
 #endif
-	}
+		}
 #endif
 	intro();
 
 	if (init())
 	{
+		play_sound(SND_WELCOME);
 		while(!exit_main_loop)
 		{
-			switch (selection())
+			switch (selection(mus))
 			{
 				case 0:
 					new_game();
+					mus=0;
 					break;
 				case 1:
 					continue_game();
+					mus=0;
 					break;
 				case 2:
 					language();
+					mus=1;
 					break;
 				case 3:
 					records();
+					mus=1;
 					break;
 				default:
 					exit_game();
 			}
 		}
 	}
+#ifndef GP32
+	else
+		printf("Init ERROR ! ! ! : %s\n",SDL_GetError());
+#endif
+	
 	quit();
 
 #ifdef GP32

File src/vorton.h

  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#define VORTON_VERSION "Alpha-3"
+
+
 /*
 ------------------------------------
 - Definiciones Generales del Juego -
 enum {
 	IMG_LOGO,
 	IMG_MENU,
+	IMG_STAR,
+	IMG_RECORDS_BACKGROUND_0,
+	IMG_RECORDS_BACKGROUND_1,
+	IMG_LANGUAGE_BACKGROUND,
 	IMG_HERO_0_0,
 	IMG_HERO_1_0,
 	IMG_HERO_2_0,
 	IMG_HERO_5_2,
 	IMG_HERO_6_2,
 	IMG_HERO_7_2,
+	IMG_HERO_HIT_0,
+	IMG_HERO_HIT_1,
+	IMG_HERO_HIT_2,
+	IMG_HERO_HIT_3,
 	IMG_DUMMY_0,
 	IMG_DUMMY_1,
 	IMG_DUMMY_2,
 	IMG_ENERGY_7,
 	IMG_ENERGY_8,
 	IMG_FONT_OPTIONS,
+	IMG_FONT_GAME,
 	IMG_PYRAMID0,
 	IMG_PYRAMID1,
 	IMG_PYRAMID2,
 	SND_LASER,
 	SND_HIT,
 	SND_BLOW,
+	SND_EXPL,
+	SND_ACTIVE,
+	SND_THRUST,
+	SND_WELCOME,
+	SND_BYE,
+	SND_AWESOME,
+	SND_GAMEOVER,
+	SND_HURRY,
+	SND_PAUSE,
+	SND_READY,
+	SND_PING,
 	NUM_SOUNDS
 };
 
 
 /* Imagenes por segundo */
 /* FIXME: En GP32 aun no depurado: desactivado */
-#define FPS (1000 / 60)
+#define FPS (1000 / 50)
 #define FPS2 (FPS / 2)
 
 
 /*Discos: Enemigos, Moviles, Descuentan vida, Van hacia el heroe */
 /* Trayectoria por defecto = 8 */
 enum{
+	TYPE_NULL,
 	TYPE_HERO,
 	TYPE_PYRAMID,
 	TYPE_DUMMY,
 	TYPE_ROBOT,
 	TYPE_LASER,
 	TYPE_BARREL,
+	TYPE_EXPL,
 	TYPE_ELECTRIC
 };
 
 extern int lasers;
 extern int spin_laser;
 
+#ifdef ARGS
+
+/*Argumento Sonido*/
+extern int sound_arg;
+
+/* Argumento Fullscreen */
+extern int fullscreen_arg;
+
+/* Argumento bitscolor */
+extern int bitscolor_arg;
+
+/* Argumento mono */
+extern int monosound_arg;
+
+/* Argumento_lowsound */
+extern int lowsound_arg;
+
+#endif
+
+
+/* Fin de proceso */
+extern int theend;
+
 /* Tiempo */
 extern int game_time;
 
 extern int ship_x;
 extern int ship_y;
 
+extern char *video_msg;
+
 /* Primer objeto de la lista de visualizacion */
 extern object *first;
 
 /* Cantidad actual de imagenes mostradas */
 extern Uint32 frame;
 
+/* Superficies */
+extern SDL_Surface *screen, *image[NUM_IMAGES];
+
 
 /* Iniciacion de video */
 extern void display_gauge(int i, int max, char *cad);
 extern int audio_init(void);
 extern int load_musics(void);
 
+extern void init_frame_time(void);
+
 /* Iniciacion de procesos */
 extern int process_init(void);
 
 /* Proceso padre */
 extern void process();
 
+extern void pauseScreen(void);
+
 /* Realizar visualizacion */
 extern void draw();
 
 /* Realizar visualizacion para inicio de nivel */
-extern void draw_init_level();
+extern void draw_init_level(void);
+extern void draw_init_level_presentation(int i, char *str);
 
 /* Funciones de proceso y choque del objecto Heroe */
+void hero_init(int x, int y, int state);
 void hero_process(object *this);
 void hero_collision(object *this, object *other);
 
 int parse_map(void);
 
 extern void music_play(int n_music);
+extern void music_play_fade(int n_music);
 extern void music_stop(void);
+extern void music_stop_fade(void);
 extern void play_sound(int n_sound);
+extern void play_thrust(void);
+extern void stop_thrust(void);
+extern void music_down(void);
+extern void music_up(void);
+extern void wait_channels(void);
+
+extern void language(void);
+extern void records(void);
 
 /* Funcion de busqueda de un hueco libre dentro del array de objetos */
 static inline int search_free_obj(void)
 	obj[index].y=-12345;
 	obj[index].collision=(void *)&bloq_collision;
 	obj[index].process=(void *)&bloq_process;
+	obj[index].obj_type=TYPE_NULL;
 }
 
 static inline void free_all_obj(void)