Commits

clach04  committed d463fca

Removed files that I think the last change should have. Done as a seperate change
in case need to rollback.

  • Participants
  • Parent commits 437c2fe

Comments (0)

Files changed (68)

File data/1/block0.png

Removed
Old image

File data/common/dummy0.png

Removed
Old image

File data/common/dummy1.png

Removed
Old image

File data/common/dummy2.png

Removed
Old image

File data/common/energy0.png

Removed
Old image

File data/common/energy1.png

Removed
Old image

File data/common/energy2.png

Removed
Old image

File data/common/energy3.png

Removed
Old image

File data/common/energy4.png

Removed
Old image

File data/common/energy5.png

Removed
Old image

File data/common/energy6.png

Removed
Old image

File data/common/energy7.png

Removed
Old image

File data/common/energy8.png

Removed
Old image

File data/common/expl0.png

Removed
Old image

File data/common/expl1.png

Removed
Old image

File data/common/expl2.png

Removed
Old image

File data/common/expl3.png

Removed
Old image

File data/common/expl4.png

Removed
Old image

File data/common/hero00.png

Removed
Old image

File data/common/hero01.png

Removed
Old image

File data/common/hero02.png

Removed
Old image

File data/common/hero0e.png

Removed
Old image

File data/common/hero10.png

Removed
Old image

File data/common/hero11.png

Removed
Old image

File data/common/hero12.png

Removed
Old image

File data/common/hero1e.png

Removed
Old image

File data/common/hero20.png

Removed
Old image

File data/common/hero21.png

Removed
Old image

File data/common/hero22.png

Removed
Old image

File data/common/hero2e.png

Removed
Old image

File data/common/hero30.png

Removed
Old image

File data/common/hero31.png

Removed
Old image

File data/common/hero32.png

Removed
Old image

File data/common/hero3e.png

Removed
Old image

File data/common/hero40.png

Removed
Old image

File data/common/hero41.png

Removed
Old image

File data/common/hero42.png

Removed
Old image

File data/common/hero50.png

Removed
Old image

File data/common/hero51.png

Removed
Old image

File data/common/hero52.png

Removed
Old image

File data/common/hero60.png

Removed
Old image

File data/common/hero61.png

Removed
Old image

File data/common/hero62.png

Removed
Old image

File data/common/hero70.png

Removed
Old image

File data/common/hero71.png

Removed
Old image

File data/common/hero72.png

Removed
Old image

File data/common/laser0.png

Removed
Old image

File data/common/laser1.png

Removed
Old image

File data/common/laser2.png

Removed
Old image

File data/common/laser3.png

Removed
Old image

File data/common/letters.png

Removed
Old image

File data/common/pyramid0.png

Removed
Old image

File data/common/pyramid1.png

Removed
Old image

File data/common/pyramid2.png

Removed
Old image

File data/common/ship.png

Removed
Old image

File data/common/tnumbers.png

Removed
Old image

File src/bloq.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
- */
-
-/*
------------------
-- Objeto Bloque -
------------------
-*/
-
-
-/* Definiciones generales */
-#include "vorton.h"
-
-void bloq_process(object *this)
-{
-}
-
-void bloq_collision(object *this, object *other)
-{
-}
-
-void bloq_init(object *this)
-{
-	switch(this->obj_type)
-	{
-		case TYPE_BLOQ:
-			this->img=IMG_BLOCK_0;
-			break;
-		case TYPE_TILE:
-			this->img=IMG_TILE;
-			break;
-	}
-	this->process=(void *)&bloq_process;
-	this->collision=(void *)&bloq_collision;
-}

File src/brick.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
- */
-
-/*
------------------
-- Objeto Brick  -
------------------
-*/
-
-
-/* Definiciones generales */
-#include "vorton.h"
-
-void brick_process(object *this)
-{
-}
-
-void brick_collision(object *this, object *other)
-{
-	if ((other->obj_type==TYPE_LASER)||(other->obj_type==TYPE_NULL))
-	{
-		this->move_type--;
-		if (!this->move_type)
-		{
-			free_obj(this->position);
-		}
-		else
-			this->img++;
-	}
-}
-
-void brick_init(object *this)
-{
-	this->img=IMG_BRICK_0;
-	this->process=(void *)&brick_process;
-	this->collision=(void *)&brick_collision;
-	this->move_type=4;
-}

File src/dummy.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
- */
-
-/*
----------------------
-- Objeto Robot Nulo -
----------------------
-*/
-
-
-int dummy_img[4];
-int dummy_color=0;
-
-/* Definiciones generales */
-#include "vorton.h"
-
-#define VEL_COLOR 0x7
-
-void dummy_collision(object *this, object *other)
-{
-	if (other->position<this->position)
-		this->y=this->back_y;
-	if (!this->iter)
-		if (other->obj_type==TYPE_CYCLOP ||
-		    other->obj_type==TYPE_MOUTH ||
-		    other->obj_type==TYPE_MINE ||
-		    other->obj_type==TYPE_DISC ||
-		    other->obj_type==TYPE_ROBOT )
-		{
-			play_sound(SND_DUMMY);
-		 	this->iter=1;
-		}
-}
-
-void dummy_process(object *this)
-{
-	static int first=0;
-	int y;
-
-	if (this->iter)
-	{
-		this->iter++;
-		if (this->iter<50)
-			this->img=dummy_img[this->iter&0x3];
-		else
-		{
-			if (this->state<0)
-			{
-				if (this->iter==51)
-					play_sound(SND_EXPL);
-				else if (this->iter==55)
-					this->img=IMG_EXPL2;
-				else if (this->iter==60)
-					this->img=IMG_EXPL1;
-				else if (this->iter==65)
-					this->img=IMG_EXPL4;
-				else if (this->iter==70)
-					this->img=IMG_EXPL0;
-				else if (this->iter>75)
-				{
-					for(y=this->position+1;obj[y].obj_type==TYPE_DUMMY;y++)
-					{
-						obj[y-1].iter=0;
-						obj[y-1].y=obj[y].y;
-						obj[y-1].state=obj[y].state;
-					}
-					free_obj(y-1);
-				}
-			}
-			else
-			{
-				if (!hero_hiting)
-				{
-					this->state--;
-					this->iter=0;
-				}
-			}
-		}
-	}
-	else
-	{
-		if (!(frame & VEL_COLOR))
-		{
-			if (first)
-			{
-				dummy_color=(dummy_color+1)&0x3;
-				first=0;
-			}
-			this->img=dummy_img[dummy_color];
-		}
-		else
-			first=1;
-	}
-	y=obj[this->position-1].y-TILE_SIZE;
-	if (y<MAX_Y)
-		this->y=y;
-}
-
-void dummy_init(object *this, int y)
-{
-	this->x=64;
-	this->y=obj[0].y-y;
-	this->back_x=64;
-	this->back_y=obj[0].y-y;
-	this->obj_type=TYPE_DUMMY;
-	this->img=IMG_DUMMY_0;
-	this->size_x=TILE_SIZE;
-	this->size_y=TILE_SIZE;
-	this->process=(void *)&dummy_process;
-	this->collision=(void *)&dummy_collision;
-	this->state=8;
-	this->iter=0;
-
-	dummy_img[0]=IMG_DUMMY_0;
-	dummy_img[1]=IMG_DUMMY_1;
-	dummy_img[2]=IMG_DUMMY_2;
-	dummy_img[3]=IMG_DUMMY_1;
-}
-

File src/fire.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
- */
-
-/*
------------------
-- Objeto Fire  -
------------------
-*/
-
-
-/* Definiciones generales */
-#include "vorton.h"
-
-void fire_process(object *this)
-{
-	this->move_type=(this->move_type+1)&0x3;
-	if (!this->move_type)
-		this->rot=(this->rot+1)&0x3;
-}
-
-void fire_collision(object *this, object *other)
-{
-}
-
-void fire_init(object *this)
-{
-	this->img=IMG_FIRE_0;
-	this->process=(void *)&fire_process;
-	this->collision=(void *)&fire_collision;
-	this->move_type=0;
-}

File src/fondo.h

-
-#ifndef FONDOS_H
-#define FONDOS_H
-
-#define FONDO_X 50
-#define FONDO_Y 10
-#define FONDO_ESTRELLA 100
-
-unsigned char fondo[FONDO_Y][FONDO_X]=
-{
-	{ 0,1,2,3,2,1,0,1,0,2, 0,2,0,0,1,3,2,1,0,2, 3,2,1,3,0,3,0,2,1,0, 0,2,1,3,0,0,3,2,1,0, 0,1,2,3,2,1,0,1,0,2 },
-	{ 3,2,1,4,0,3,0,2,1,0, 0,1,2,3,2,1,0,1,0,2, 3,2,1,1,0,3,0,2,1,0, 0,1,2,3,2,1,0,1,0,2, 3,2,1,4,0,3,0,2,1,0 },
-	{ 1,3,0,0,3,2,1,0,3,3, 0,1,2,3,2,1,0,1,0,2, 0,2,0,0,1,3,2,1,0,2, 3,2,1,2,0,3,0,2,1,0, 1,3,0,0,3,2,1,0,3,3 },
-	{ 2,1,0,1,2,0,2,1,0,1, 2,1,0,1,2,3,2,7,0,1, 1,3,0,0,3,2,1,0,3,3, 3,1,6,2,1,2,5,3,0,2, 2,1,0,1,2,0,2,1,0,1 },
-	{ 0,2,1,3,0,0,3,2,1,0, 3,2,1,2,0,3,0,2,1,0, 0,1,2,3,2,1,0,1,0,2, 0,2,0,0,1,3,2,1,0,2, 0,2,1,3,0,0,3,2,1,0 },
-	{ 3,1,2,1,2,0,3,0,2,6, 0,2,1,3,0,0,3,2,1,0, 0,2,0,0,1,3,2,1,0,2, 3,2,1,2,0,3,0,2,1,0, 3,1,2,1,2,0,3,0,2,6 },
-	{ 1,0,1,3,0,0,3,2,1,0, 3,2,1,2,0,3,0,2,1,0, 0,1,2,3,2,1,0,1,0,2, 3,2,1,2,0,3,0,2,1,0, 1,0,1,3,0,0,3,2,1,0 },
-	{ 3,1,0,1,2,3,2,1,3,1, 2,1,0,1,2,5,2,1,0,1, 2,1,0,1,2,3,2,1,0,1, 1,3,0,0,3,2,1,0,3,3, 3,1,0,1,2,3,2,1,3,1 },
-	{ 1,3,0,0,3,2,1,0,3,3, 3,1,0,2,1,2,0,3,0,2, 0,2,1,4,0,0,3,2,1,0, 0,2,0,0,1,3,2,1,0,2, 1,3,0,0,3,2,1,0,3,3 },
-	{ 0,2,0,0,1,3,2,1,0,2, 1,0,1,3,0,0,3,2,1,0, 3,2,1,0,3,0,2,1,0,7, 0,1,2,3,2,1,0,1,0,2, 0,2,0,0,1,3,2,1,0,2 }
-};
-
-unsigned short fondo_estrella[FONDO_ESTRELLA]=
-{
-	116, 21,130,146, 57, 60, 70,186, 92,191,
-	 15,122, 30,147,158,160, 70,184,191,132,
-	115, 73,130, 48,159,200,170, 05,199, 83,
-	 16,174,130, 39, 50,160, 70, 84, 98, 04,
-	211, 52,130, 64,146,134,170,183, 90,105,
-	122, 30,147,160, 70,184,191, 32,157, 60,
-	 21,146, 57, 60,170, 86, 92,191,147,122,
-	 73,130,159,202,170,205,199, 83, 48,193,
-	130, 64,146,234,170, 83,190,105,111, 21,
-	 74, 30,150,160, 70,184, 98,204,184,169
-};
-
-#endif

File src/hero.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
- */
-
-/*
-----------------
-- Objeto Heroe -
-----------------
-*/
-
-
-/* Definiciones generales */
-#include "vorton.h"
-
-/* Variables Globales */
-extern int left_pressed;		/* Booleano: Pulsado pad izquierda */
-extern int right_pressed;		/* Booleano: Pulsado pad derecha */
-extern int up_pressed;			/* Booleano: Pulsado pad arriba */
-extern int down_pressed;		/* Booleano: Pulsado pad abajo */
-extern int hit1_pressed;		/* Booleano: Pulsado disparo 1 */
-extern int hit2_pressed;		/* Booleano: Pulsado disparo 2 */
-extern int return_pressed;		/* Booleano: Pulsado Start */
-extern int space_pressed;		/* Booleano: Pulsado Select */
-extern int tab_pressed;			/* Booleano: Pulsado L */
-extern int backspace_pressed;		/* Booleano: Pulsado R */
-
-static int hero_moving=0;
-
-int hero_mov[48]= {
-		IMG_HERO_0_0, IMG_HERO_0_0, IMG_HERO_0_0,
-		IMG_HERO_0_0, IMG_HERO_0_0, IMG_HERO_0_0,
-		IMG_HERO_0_0, IMG_HERO_0_0, IMG_HERO_0_0,
-		IMG_HERO_0_0, IMG_HERO_0_0, IMG_HERO_0_0,
-		IMG_HERO_0_1, IMG_HERO_0_1, IMG_HERO_0_1,
-		IMG_HERO_0_1, IMG_HERO_0_1, IMG_HERO_0_1,
-		IMG_HERO_0_1, IMG_HERO_0_1, IMG_HERO_0_1,
-		IMG_HERO_0_1, IMG_HERO_0_1, IMG_HERO_0_1,
-		IMG_HERO_0_2, IMG_HERO_0_2, IMG_HERO_0_2,
-		IMG_HERO_0_2, IMG_HERO_0_2, IMG_HERO_0_2,
-		IMG_HERO_0_2, IMG_HERO_0_2, IMG_HERO_0_2,
-		IMG_HERO_0_2, IMG_HERO_0_2, IMG_HERO_0_2,
-		IMG_HERO_0_1, IMG_HERO_0_1, IMG_HERO_0_1,
-		IMG_HERO_0_1, IMG_HERO_0_1, IMG_HERO_0_1,
-		IMG_HERO_0_1, IMG_HERO_0_1, IMG_HERO_0_1,
-		IMG_HERO_0_1, IMG_HERO_0_1, IMG_HERO_0_1
-};
-
-int hero_accel[10]= { 0,1,1,2,2,2,3,3,3,3 };
-
-int hero_accel_x[10][8][2]=
-{
-	{ { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },
-
-	{ {-1,-1}, {-1, 0}, { 0, 0}, { 1, 0}, { 1, 1}, { 1, 0}, { 0, 0}, {-1, 0} },
-	{ {-1,-1}, {-1, 0}, { 0, 0}, { 1, 0}, { 1, 1}, { 1, 0}, { 0, 0}, {-1, 0} },
-
-	{ {-2,-2}, {-1,-1}, { 0, 0}, { 1, 1}, { 2, 2}, { 1, 1}, { 0, 0}, {-1,-1} },
-	{ {-2,-2}, {-1,-1}, { 0, 0}, { 1, 1}, { 2, 2}, { 1, 1}, { 0, 0}, {-1,-1} },
-	{ {-2,-2}, {-1,-1}, { 0, 0}, { 1, 1}, { 2, 2}, { 1, 1}, { 0, 0}, {-1,-1} },
-
-	{ {-3,-3}, {-2,-1}, { 0, 0}, { 2, 1}, { 3, 3}, { 2, 1}, { 0, 0}, {-2,-1} },
-	{ {-3,-3}, {-2,-1}, { 0, 0}, { 2, 1}, { 3, 3}, { 2, 1}, { 0, 0}, {-2,-1} },
-	{ {-3,-3}, {-2,-1}, { 0, 0}, { 2, 1}, { 3, 3}, { 2, 1}, { 0, 0}, {-2,-1} },
-	{ {-3,-3}, {-2,-1}, { 0, 0}, { 2, 1}, { 3, 3}, { 2, 1}, { 0, 0}, {-2,-1} },
-};
-
-int hero_accel_y[10][8][2]=
-{
-	{ { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },
-
-	{ { 0, 0}, {-1, 0}, {-1,-1}, {-1, 0}, { 0, 0}, { 1, 0}, { 1, 1}, { 1, 0} },
-	{ { 0, 0}, {-1, 0}, {-1,-1}, {-1, 0}, { 0, 0}, { 1, 0}, { 1, 1}, { 1, 0} },
-
-	{ { 0, 0}, {-1,-1}, {-2,-2}, {-1,-1}, { 0, 0}, { 1, 1}, { 2, 2}, { 1, 1} },
-	{ { 0, 0}, {-1,-1}, {-2,-2}, {-1,-1}, { 0, 0}, { 1, 1}, { 2, 2}, { 1, 1} },
-	{ { 0, 0}, {-1,-1}, {-2,-2}, {-1,-1}, { 0, 0}, { 1, 1}, { 2, 2}, { 1, 1} },
-
-	{ { 0, 0}, {-1,-2}, {-3,-3}, {-1,-2}, { 0, 0}, { 1, 2}, { 3, 3}, { 1, 2} },
-	{ { 0, 0}, {-1,-2}, {-3,-3}, {-1,-2}, { 0, 0}, { 1, 2}, { 3, 3}, { 1, 2} },
-	{ { 0, 0}, {-1,-2}, {-3,-3}, {-1,-2}, { 0, 0}, { 1, 2}, { 3, 3}, { 1, 2} },
-	{ { 0, 0}, {-1,-2}, {-3,-3}, {-1,-2}, { 0, 0}, { 1, 2}, { 3, 3}, { 1, 2} },
-};
-
-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.
-	Cada 4 frames obtiene las pulsaciones del PAD y actua en consecuencia.
-	Actualiza las coordenadas cartesianas del Heroe respecto a su velocidad actual.
-*/
-
-void hero_process(object *this)
-{
-	if (!hero_hiting)
-	{
-		if (!(frame%4))
-		{
-			if (left_pressed)
-				hero.rot=((hero.rot+1)%8);
-			else
-			if (right_pressed)
-				hero.rot=(((unsigned int)(hero.rot-1))%8);
-			if (up_pressed)
-			{
-				if (hero.vel<MAX_VEL)
-					hero.vel++;
-				hero.push_x=0;
-				hero.push_y=0;
-			}
-			else
-			if (down_pressed)
-				if (hero.vel>0)
-					hero.vel--;
-	
-			if ((hit1_pressed)||(hit2_pressed))
-				laser_init();
-			else
-				spin_laser--;
-			
-		}
-	
-		hero.back_x=hero.x;
-		hero.back_y=hero.y;
-		hero.x+=hero_accel_x[hero.vel][hero.rot][hero.move_type] + hero.push_x;
-		hero.y+=hero_accel_y[hero.vel][hero.rot][hero.move_type] + hero.push_y;
-		hero.move_type^=1;
-		
-		if (hero.x>MAX_X)
-		{
-			hero.x=MAX_X;
-			hero.vel=0;
-		}
-		else
-		if (hero.x<MIN_X)
-		{
-			hero.x=MIN_X;
-			hero.vel=0;
-		}
-		if (hero.y>MAX_Y)
-		{
-			hero.y=MAX_Y;
-			hero.vel=0;
-		}
-		else
-		if (hero.y<MIN_Y)
-		{
-			hero.y=MIN_Y;
-			hero.vel=0;
-		}
-	
-		if (hero.y-global_pos>SCROLL_MAX)
-			global_pos+=hero_accel[hero.vel] + hero.push_y;
-		else
-		if (hero.y-global_pos<SCROLL_MIN)
-			global_pos-=hero_accel[hero.vel] - hero.push_y;
-	
-		if (hero.vel)
-		{
-			hero_moving+=hero.vel;
-			hero_moving%=48;
-			hero.img=hero_mov[hero_moving];
-		}
-		else
-		{
-			hero_moving=0;
-			hero.img=IMG_HERO_0_1;
-		}
-	}
-	else
-	{
-		hero_hiting++;
-		hero.vel=0;
-		if (hero_hiting>9)
-		{
-			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+1)%8;
-	}
-}
-
-static inline void hero_stop(object *this, object *other)
-{
-	other->push_x+=this->x - this->back_x;
-	other->push_y+=this->y - this->back_y;
-	hero.x=hero.back_x;
-	hero.y=hero.back_y;
-	hero.vel=1;
-}
-
-static inline void hero_hit(object *this, object *other)
-{
-	if (!hero_hiting)
-	{
-		play_sound(SND_BLOW);
-		hero_hiting=1;
-		hero.state--;
-	}
-}
-
-void hero_collision(object *this, object *other)
-{
-	switch (other->obj_type)
-	{
-		case TYPE_MINE:
-		case TYPE_MOUTH:
-		case TYPE_DISC:
-		case TYPE_ELECTRIC:
-		case TYPE_CYCLOP:
-		case TYPE_ROBOT:
-		case TYPE_FIRE:
-			hero_hit(this, other);
-		case TYPE_BLOQ:
-		case TYPE_DUSTBIN:
-		case TYPE_BARREL:
-		case TYPE_DUMMY:
-		case TYPE_BRICK:
-		case TYPE_DEFL1:
-		case TYPE_DEFL2:
-		case TYPE_PYRAMID:
-		case TYPE_TILE:
-			hero_stop(this, other);
-			break;
-	}
-}

File src/laser.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"
-
-int lasers=0;
-int spin_laser=0;
-
-#define TILE2 (TILE_SIZE / 2)
-// #define TILE2 ((4*TILE_SIZE)/3)
-
-//static int init_x[8]= { -TILE2, -TILE2, 0, TILE2, TILE2, TILE2, 0, -TILE2 };
-//static int init_y[8]= { 0, -TILE2, -TILE2, -TILE2, 0, TILE2, TILE2, TILE2 };
-
-static int imag[HIT_TIME_LIFE+4]=
-{
-	IMG_LASER_0, IMG_LASER_0, IMG_LASER_0, IMG_LASER_0,
-	IMG_LASER_0, IMG_LASER_0, IMG_LASER_1, IMG_LASER_1,
-	IMG_LASER_1, IMG_LASER_1, IMG_LASER_1, IMG_LASER_2,
-	IMG_LASER_2, IMG_LASER_2, IMG_LASER_3, IMG_LASER_3,
-	IMG_LASER_3, IMG_LASER_3, IMG_LASER_2, IMG_LASER_2,
-	IMG_LASER_1, IMG_LASER_1, IMG_LASER_0, IMG_LASER_0,
-	IMG_LASER_0, IMG_LASER_0, IMG_LASER_0, IMG_LASER_0
-};
-
-static inline void free_laser(int position)
-{
-	if (obj[position].sign>=0)
-	{
-		free_obj(position);
-		lasers--;
-		obj[position].sign=-1;
-	}
-}
-
-void laser_process(object *this)
-{
-//    if (this->x > 0)
-//    {
- 	switch(this->direction)
-	 {
-			
-			case 7:
-				this->y+=this->vel;
-				this->x-=this->vel;
-				break;
-			case 0:
-				this->x-=this->vel;
-				this->x-=this->vel;
-			
-				break;
-			case 1:
-				this->x-=this->vel;
-				this->y-=this->vel;
-				
-				break;
-			case 2:
-				this->y-=this->vel;
-				this->y-=this->vel;
-				
-				break;
-			case 3:
-				this->y-=this->vel;
-				this->x+=this->vel;
-			
-				break;
-			case 4:
-				this->x+=this->vel;
-				this->x+=this->vel;
-				
-				break;
-			case 5:
-				this->x+=this->vel;
-				this->y+=this->vel;
-				
-				break;
-			default:
-				this->y+=this->vel;
-				this->y+=this->vel;
-				
-	}
-
-	this->sign--;
-
-	register int draw_y=(this->x-this->y+global_pos);
-
-	if ( (this->sign<0) || (this->x<=0) || (draw_y<=MIN_VISUAL) ||(draw_y>=MAX_VISUAL) )
-	{
-		this->sign=0;
-		free_laser(this->position);
-	}
-	else
-	{
-		this->img=imag[this->sign];
-	}
-//   }
-}
-
-/* Incluido c�digo para gestionar la explosi�n de los robots */
-/* Fecha �ltima modificaci�n : 18/10/03 */
-
-void laser_collision(object *this, object *other)
-{
-
-//if (this->position!=other->position) /*#*/
-//{
-	switch(other->obj_type)
-	{
-//Objetos en los que el laser no hace nada
-		case TYPE_DUMMY:
-		case TYPE_DUSTBIN:
-		case TYPE_BRICK:
-		case TYPE_BLOQ:
-		case TYPE_MINE:
-			other->push_x+=this->x - this->back_x;
-			other->push_y+=this->y - this->back_y;
-			free_laser(this->position);
-			break;
-		
-//Objetos en los que el laser mata
-		case TYPE_MOUTH:
-		case TYPE_ROBOT:
-		case TYPE_CYCLOP:
-		case TYPE_DISC:
-			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;
-
-//Objeto especial espejo
-		case TYPE_DEFL1:
-			this->direction=(this->direction+1)%0x7;
-			break;
-
-//Objeto especial espejo con otro angulo
-		case TYPE_DEFL2:
-			if (this->direction<1)
-				this->direction=7;
-			else
-				this->direction--;
-			break;
-	}
-//}	
-}
-
-void laser_init(void)
-{
-	if (lasers>=spin_laser)
-	{
-		int index=search_free_obj();
-	
-		if (index>=0)
-		{
-			play_sound(SND_LASER);
-//			obj[index].x=hero.x+init_x[hero.rot]; //+(hero_accel_x[hero.vel][hero.rot][0]*2);
-//			obj[index].y=hero.y+init_y[hero.rot]; //+(hero_accel_y[hero.vel][hero.rot][0]*2);
-			obj[index].x=hero.x+(hero_accel_x[hero.vel][hero.rot][0]);
-			obj[index].y=hero.y+(hero_accel_y[hero.vel][hero.rot][0]);
-			obj[index].direction=hero.rot;
-			obj[index].vel=2;
-			obj[index].state=1;
-			obj[index].img=IMG_LASER_0;
-			obj[index].back_x=obj[index].x;
-			obj[index].back_y=obj[index].y;
-			obj[index].process=(void *)&laser_process;
-			obj[index].collision=(void *)&laser_collision;
-			obj[index].size_x=TILE_SIZE;
-			obj[index].size_y=TILE_SIZE;
-			obj[index].position=index;
-			obj[index].sign=HIT_TIME_LIFE;
-			obj[index].obj_type=TYPE_LASER;
-			lasers++;
-			spin_laser=lasers<<1;
-		}
-	}
-	else
-		spin_laser--;
-}

File src/movable.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"
-
-void movable_collision(object *this, object *other)
-{
-	other->push_x+=this->x - this->back_x;
-	other->push_y+=this->y - this->back_y;
-	this->x=this->back_x;
-	this->y=this->back_y;
-}
-
-void movable_process(object *this)
-{
-	this->x+=this->push_x;
-	this->y+=this->push_y;
-	limXY(this);
-}
-
-void movable_init(object *this)
-{
-	switch(this->obj_type)
-	{
-		case TYPE_DUSTBIN:
-			this->img=IMG_DUSTBIN;
-			break;
-	}
-	this->process=(void *)&movable_process;
-	this->collision=(void *)&movable_collision;
-}

File src/parse.c

-#include <stdio.h>
-#include "vorton.h"
-
-#define STR_OBJ		"OBJ"
-#define STR_NO_OBJ	"/OBJ"
-#define STR_X		"X "
-#define STR_Y		"Y "
-#define STR_ROT		"ROT "
-#define STR_VEL		"VEL "
-#define STR_STATE	"STATE "
-#define STR_MOVE	"MOVE "
-#define STR_TYPE	"TYPE "
-#define STR_TYPE_BLOQ	"BLOQ"
-#define STR_TYPE_DUST	"DUSTBIN"
-#define STR_TYPE_FLAME	"FLAME"
-#define STR_TYPE_DEFL1	"DEFL1"
-#define STR_TYPE_DEFL2	"DEFL2"
-#define STR_TYPE_CICLO	"CYCLOP"
-#define STR_TYPE_ROBOT	"ROBOT"
-#define STR_TYPE_MOUTH	"MOUTH"
-#define STR_TYPE_MINE	"MINE"
-#define STR_TYPE_DISC	"DISC"
-#define STR_TYPE_BRICK	"BRICK"
-#define STR_TYPE_FIRE	"FIRE"
-#define STR_TYPE_TILE	"TILE"
-#define STR_SIZE_X	"SIZE_X "
-#define STR_SIZE_Y	"SIZE_Y "
-#define STR_ITER	"ITER "
-#define STR_VEC_X	"VEC_X "
-#define STR_VEC_Y	"VEC_Y "
-#define STR_SIGN	"SIGN "
-
-
-static inline void *read_map(char *map_name, int *size)
-{
-	size_t s=0;
-	void *ret=NULL;
-	FILE *f=NULL;
-
-	f=fopen(map_name,"rb");
-	if (f!=NULL)
-	{
-		fseek(f,0,SEEK_END);
-		s=ftell(f);
-		fseek(f,0,SEEK_SET);
-		ret=calloc(1,s+10);
-		if (ret!=NULL)
-			if (fread(ret+1,1,s,f)!=s)
-			{
-				free(ret);
-				ret=NULL;
-				s=0;
-			}
-		fclose(f);
-	}
-	(*size)=(int)s;
-	return ret;
-}
-
-static inline void split_mem(void *mem, int size)
-{
-	int i, op=0;
-	char *c=(char *)mem;
-
-	for(i=0;i<size;i++)
-		if (c[i]==13 || c[i]==10)
-			c[i]=0;
-		else
-		if (c[i]>='a' && c[i]<='z')
-			c[i]-=('a'-'A');
-		else
-		if ((!op) && (c[i]=='<'))
-		{
-			c[i]=0;
-			op=1;
-		}
-		else
-		if ((op) && (c[i]=='>'))
-		{
-			c[i]=0;
-			op=0;
-		}
-}
-
-static inline char *next_string(void *mem, int *index, int size)
-{
-	int i,j;
-	char *c=(char *)mem;
-
-	for(i=(*index);i<size;i++)
-		if (c[i]==0)
-		{
-			for(j=i+1;j<size;j++)
-				if (c[j]!=0)
-				{
-					(*index)=j;
-					return ((char *)(mem+j));
-				}
-			break;
-		}
-	(*index)=size;
-	return NULL;
-}
-
-static inline int get_num(char *st)
-{
-	int i, ret=0;
-	char c='>';
-
-	for(i=0;i<100;i++)
-		if ((st[i]<'0')||(st[i]>'9'))
-		{
-			c=st[i];
-			st[i]=0;
-			break;
-		}
-	sscanf(st, "%i", &ret);
-	st[i]=c;
-	return ret;
-}
-
-int parse_map(void)
-{
-	char *map_name=(char *)calloc(1024,1);
-	void *mem=NULL;
-	char *st=NULL;
-	int index=0, size;
-	int n_obj=-1;
-
-	if (map_name==NULL)
-		return -1;
-	sprintf(map_name,"%s%i%s%s",DATA_PREFIX,level,FILE_SEPARATOR,"level.map");
-
-	mem=read_map(map_name, &size);
-	if (mem!=NULL)
-	{
-		split_mem(mem,size);
-		while((st=next_string(mem,&index,size))!=NULL)
-		{
-			if (n_obj<0)
-			{
-				if (!strcmp(st,STR_OBJ))
-				{
-					n_obj=search_free_obj();
-					if (n_obj>=0)
-					{
-						obj[n_obj].push_x=0;
-						obj[n_obj].push_y=0;
-						obj[n_obj].position=n_obj;
-						obj[n_obj].rot=0;
-						obj[n_obj].state=1;
-						obj[n_obj].vel=2;
-						obj[n_obj].move_type=9;
-						obj[n_obj].obj_type=TYPE_MINE;
-						obj[n_obj].img=IMG_MINE_0;
-						obj[n_obj].size_x=TILE_SIZE;
-						obj[n_obj].size_y=TILE_SIZE;
-						obj[n_obj].iter=1;
-						obj[n_obj].vec_x=0;
-						obj[n_obj].vec_y=0;
-						obj[n_obj].sign=0;
-					}
-				}
-			}
-			else
-			{
-				if (!strcmp(st,STR_NO_OBJ))
-				{
-/*
-#ifdef DEBUG
-					printf("OBJ %i X=%i Y=%i, Rot=%i Vel=%i State=%i Move=%i Type=%i Size_X=%i Size_Y=%i Iter=%i Vec_X=%i Vec_Y=%i Sign=%i\n", n_obj, obj[n_obj].x, obj[n_obj].y, obj[n_obj].rot, obj[n_obj].vel, obj[n_obj].state, obj[n_obj].move_type, obj[n_obj].obj_type, obj[n_obj].size_x, obj[n_obj].size_y, obj[n_obj].iter, obj[n_obj].vec_x, obj[n_obj].vec_y, obj[n_obj].sign);
-#endif
-*/
-					obj[n_obj].back_x=obj[n_obj].x;
-					obj[n_obj].back_y=obj[n_obj].y;
-					switch(obj[n_obj].obj_type)
-					{
-						case TYPE_FIRE:
-							fire_init(&obj[n_obj]);
-							break;
-						case TYPE_BRICK:
-							brick_init(&obj[n_obj]);
-							break;
-						case TYPE_DUSTBIN:
-							movable_init(&obj[n_obj]);
-							break;
-						case TYPE_BLOQ:
-						case TYPE_TILE:
-							bloq_init(&obj[n_obj]);
-							break;
-						case TYPE_MINE:
-						case TYPE_CYCLOP:
-						case TYPE_MOUTH:
-						case TYPE_DISC:
-						case TYPE_ROBOT:
-							robot_init(&obj[n_obj]);
-							break;			
-					}
-					n_obj=-1;
-				}
-				else
-				if (!strncmp(st,STR_X,2))
-					obj[n_obj].x=MIN_X+get_num(st+2);
-				else
-				if (!strncmp(st,STR_Y,2))
-					obj[n_obj].y=160+get_num(st+2);
-				else
-				if (!strncmp(st,STR_ROT,4))
-					obj[n_obj].rot=get_num(st+4);
-				else
-				if (!strncmp(st,STR_VEL,4))
-					obj[n_obj].vel=get_num(st+4);
-				else
-				if (!strncmp(st,STR_STATE,6))
-					obj[n_obj].state=get_num(st+6);
-				else
-				if (!strncmp(st,STR_MOVE,5))
-					obj[n_obj].move_type=get_num(st+5);
-				else
-				if (!strncmp(st,STR_TYPE,5))
-				{
-					if (!strcmp(st+5,STR_TYPE_DUST))
-						obj[n_obj].obj_type=TYPE_DUSTBIN;
-					else
-					if (!strcmp(st+5,STR_TYPE_BLOQ))
-						obj[n_obj].obj_type=TYPE_BLOQ;
-					else
-					if (!strcmp(st+5,STR_TYPE_FLAME))
-						obj[n_obj].obj_type=TYPE_FLAME;
-					else
-					if (!strcmp(st+5,STR_TYPE_DEFL1))
-					{
-						obj[n_obj].obj_type=TYPE_DEFL1;
-						obj[n_obj].img=IMG_DEFL1;
-					}
-					else
-					if (!strcmp(st+5,STR_TYPE_DEFL2))
-					{
-						obj[n_obj].obj_type=TYPE_DEFL2;
-						obj[n_obj].img=IMG_DEFL2;
-					}
-					else
-					if (!strcmp(st+5,STR_TYPE_CICLO))
-						obj[n_obj].obj_type=TYPE_CYCLOP;
-					else
-					if (!strcmp(st+5,STR_TYPE_ROBOT))
-						obj[n_obj].obj_type=TYPE_ROBOT;
-					else
-					if (!strcmp(st+5,STR_TYPE_MOUTH))
-						obj[n_obj].obj_type=TYPE_MOUTH;
-					else
-					if (!strcmp(st+5,STR_TYPE_MINE))
-					{
-						obj[n_obj].obj_type=TYPE_MINE;
-						obj[n_obj].img=IMG_MINE_0;
-					}
-					else
-					if (!strcmp(st+5,STR_TYPE_DISC))
-						obj[n_obj].obj_type=TYPE_DISC;
-					else
-					if (!strcmp(st+5,STR_TYPE_BRICK))
-						obj[n_obj].obj_type=TYPE_BRICK;
-					else
-					if (!strcmp(st+5,STR_TYPE_FIRE))
-						obj[n_obj].obj_type=TYPE_FIRE;
-					else
-					if (!strcmp(st+5,STR_TYPE_TILE))
-						obj[n_obj].obj_type=TYPE_TILE;
-				}
-				else
-				if (!strncmp(st,STR_SIZE_X,7))
-					obj[n_obj].size_x=get_num(st+7);
-				else
-				if (!strncmp(st,STR_SIZE_Y,7))
-					obj[n_obj].size_y=get_num(st+7);
-				else
-				if (!strncmp(st,STR_ITER,5))
-					obj[n_obj].iter=get_num(st+5);
-				else
-				if (!strncmp(st,STR_VEC_X,6))
-					obj[n_obj].vec_x=get_num(st+6);
-				else
-				if (!strncmp(st,STR_VEC_Y,6))
-					obj[n_obj].vec_y=get_num(st+6);
-				else
-				if (!strncmp(st,STR_SIGN,5))
-					obj[n_obj].sign=get_num(st+5);
-			}
-		}
-		free(mem);
-		free(map_name);
-		return 0;
-	}
-	free(map_name);
-	return -1;
-}

File src/process.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
- */
-
-/*
------------
-- Proceso -
------------
-*/
-
-
-/* Definiciones generales */
-#include "vorton.h"
-
-/* Variables Globales */
-int left_pressed=0;		/* Booleano: Pulsado pad izquierda */
-int right_pressed=0;		/* Booleano: Pulsado pad derecha */
-int up_pressed=0;		/* Booleano: Pulsado pad arriba */
-int down_pressed=0;		/* Booleano: Pulsado pad abajo */
-int hit1_pressed=0;		/* Booleano: Pulsado disparo 1 */
-int hit2_pressed=0;		/* Booleano: Pulsado disparo 2 */
-int return_pressed=0;		/* Booleano: Pulsado Start */
-int space_pressed=0;		/* Booleano: Pulsado Select */
-int tab_pressed=0;		/* Booleano: Pulsado L */
-int backspace_pressed=0;	/* Booleano: Pulsado R */
-int theend=0;			/* Booleano: Fin de proceso */
-int completed=0;		/* Booleano: Fin de proceso */
-Uint32 next_time=0;		/* Proximo tiempo que se debe cumplir el frame actual */
-Uint32 frame=0;			/* Numero de frames */
-
-object hero;			/* Objeto Heroe */
-object obj[MAX_OBJ];		/* Resto de Objetos */
-
-int ship_x, ship_y;
-
-/*
-  FUNCION: getKey
-	Lee las pulsaciones y actualiza los booleanos
-*/
-static inline void getKey()
-{
-	SDL_Event event;
-	SDLKey key;
-	int hat=0;
-
-	while (SDL_PollEvent(&event) > 0)
-	{
-		int set=-1;
-		switch (event.type)
-		{
-			case SDL_QUIT:
-				theend=1;
-				break;
-#ifndef GP32
-			case SDL_JOYHATMOTION:
-#ifdef DREAMCAST
-			    	hat=15^SDL_JoystickGetHat(joy,event.jhat.hat);
-#else
-			    	hat=SDL_JoystickGetHat(joy,event.jhat.hat);
-#endif
-				if (hat & SDL_HAT_UP)
-					up_pressed=-1;
-				else {
-					up_pressed=0;
-					if (hat & SDL_HAT_DOWN)
-						down_pressed=-1;
-					else
-						down_pressed=0;
-				}
-				if (hat & SDL_HAT_RIGHT)
-					right_pressed=-1;
-				else {
-					right_pressed=0;
-					if (hat & SDL_HAT_LEFT)
-						left_pressed=-1;
-					else
-						left_pressed=0;
-				}
-				break;
-			case SDL_JOYBUTTONDOWN:
-				set=0;
-			case SDL_JOYBUTTONUP:
-				switch (event.jbutton.button)
-				{
-					case 1:
-						theend=-1; break;
-					case 3:
-						pauseScreen(); break;
-					default:
-						hit1_pressed=set;
-				}
-				break;
-#endif
-			case SDL_KEYUP:
-				set=0;
-			case SDL_KEYDOWN:
-				key = event.key.keysym.sym;
-				switch(key)
-				{
-					case SDLK_RETURN:
-						pauseScreen(); break;
-					case SDLK_SPACE:
-						space_pressed=set; break;
-					case SDLK_RIGHT:
-						right_pressed=set; break;
-					case SDLK_LEFT:
-						left_pressed=set; break;
-					case SDLK_UP:
-						up_pressed=set; break;
-					case SDLK_DOWN:
-						down_pressed=set; break;
-#ifdef GP32
-					case SDLK_TAB:
-#else
-					case SDLK_ESCAPE:
-#endif
-						theend=-1; break;
-					case SDLK_BACKSPACE:
-						backspace_pressed=set; break;
-					case SDLK_LCTRL:
-						hit1_pressed=set; break;
-					case SDLK_LALT:
-						hit2_pressed=set; break;
-				}
-			}
-	}
-}
-
-/*
-  FUNCION: real_collision
-  	Ejecuta el choque de los objectos
-*/
-static inline void real_collision(object *this, object *other)
-{
-	this->collision((p_object)this, (p_object)other);
-	other->collision((p_object)other, (p_object)this);
-}
-
-
-/*
-  FUNCION: collision
-  	Choque entre procesos
-*/
-static inline void collision(object *actual)
-{
-	int ax0=actual->x;
-	int ay0=actual->y;
-	int ax1=actual->x+actual->size_x;
-	int ay1=actual->y+actual->size_y;
-	object *next=first;
-	while(next!=NULL)
-	{
-		if (actual->x < 0)
-			break;
-		if (next!=actual)
-		{
-			int bx0=next->x;
-			int by0=next->y;
-			int bx1=next->x+next->size_x;
-			int by1=next->y+next->size_y;
-			if (ax0 < bx0)
-			{
-				if (ax1 > bx0)
-				{
-					if (ay0 < by0)
-					{
-						if (ay1 > by0)
-						{
-							real_collision(actual,next);
-						}
-					}
-					else
-					{
-						if (ay0 < by1)
-						{
-							real_collision(actual,next);
-						}
-					}
-				}
-				
-			}
-			else
-			{
-				if (ax0 < bx1)
-				{
-					if (ay0 < by0)
-					{
-						if (ay1 > by0)
-						{
-							real_collision(actual,next);
-						}
-					}
-					else
-					{
-						if (ay0 < by1)
-						{
-							real_collision(actual,next);
-						}	
-					}
-				}
-			}
-		}
-		next=(object *)next->next;
-	}
-}
-	
-
-/*
-  FUNCION: real_process
-	Procesos de los objetos.
-*/
-static inline void real_process(void)
-{
-	object *actual=first;
-	int hy=hero.y;
-
-	while (actual!=NULL)
-	{
-		register int y=actual->y;
-
-		if ( ((hy>y-PYRAMID_VIEW)&&(hy<y+PYRAMID_VIEW)) ||
-			(actual->obj_type==TYPE_DUMMY) )
-		{
-			actual->process((p_object)actual);
-
-			if (actual->back_x!=actual->x || actual->back_y!=actual->y)
-			{
-				actual->push_x=0;
-				actual->push_y=0;
-				collision(actual);
-			}
-			actual->back_x=actual->x;
-			actual->back_y=actual->y;
-		}
-
-		actual=(object *)actual->next;
-	}
-}
-
-/*
-  FUNCION: calcule_time
-	Proceso general del juego
-*/
-static inline void calcule_time(void)
-{
-	if (!(frame%50))
-	{
-		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;
-			}
-		}
-	}
-}
-
-/*
-  FUNCION: isframe
-	Evalua si el frame actual debe ser pintado
-	FIXME: Desactivado en GP32, hay que afinar para quitar frames
-
-static inline int isframe(void)
-{
-	static int back_frame=-1;
-	int ret=-1;
-
-	long end=next_time-SDL_GetTicks();
-	if ( end > -FPS2 )
-	{
-		if ((back_frame)&&(end>(FPS+FPS2)))
-			SDL_Delay(end-FPS);
-		ret=-1;
-	}
-	else
-		ret=0;
-	next_time+=FPS;
-	back_frame=ret;
-	return ret;
-}
-*/
-
-
-/*
-  FUNCION: process_init
-	Inicia los objetos
-*/
-int process_init(void)
-{
-	int i;
-
-	/* Inicia el Objeto heroe */
-	hero_init(64,20,8);
-
-	game_time=999;
-	lasers=0;
-	spin_laser=0;
-
-	free_all_obj();
-	pyramid_init(&obj[0]);
-
-	for(i=1;i<=lives;i++)
-	{
-		dummy_init(&obj[i],i<<3);
-		obj[i].position=i;
-	}
-
-	for(i=lives+1;i<lives+5;i++)
-	{
-		obj[i].position=i;
-		obj[i].x=MIN_X+(2*(TILE_SIZE*(i-lives)))-(TILE_SIZE/2);
-		obj[i].y=0;
-		obj[i].img=IMG_BLOCK_0;
-		obj[i].obj_type=TYPE_BLOQ;
-	}
-
-
-	return parse_map();
-}
-
-static inline void dummy_move()
-{
-	int i;
-	extern int dummy_color;
-	extern int dummy_img[];
-
-	dummy_color=(dummy_color+1)&0x3;
-
-	for(i=1;i<=lives;i++)
-		obj[i].img=dummy_img[dummy_color];
-	hero.img=dummy_img[dummy_color];
-	hero.rot=0;
-}
-
-static inline void init_level()
-{
-	int i;
-
-	global_pos=128;
-	for(i=0;i<=lives;i++)
-	{
-		obj[i].x=-2000;
-		obj[i].y=-2000;
-	}
-	hero.x=-2000;
-	hero.y=-2000;
-
-	next_time=SDL_GetTicks()+FPS;
-	ship_x=-2000;
-	ship_y=-2000;
-	for(i=0;i<60;i++)
-	{
-		draw_init_level_presentation(i, "PREPARADO");
-		delay_frame_time();
-	}
-	for(i=0;i<25;i++)
-	{
-		draw_init_level_presentation(59,"PREPARADO");
-		delay_frame_time();
-	}
-	ship_x=-200;
-	ship_y=-40;
-	play_thrust();
-	for(i=0;i<100;i++)
-	{
-		draw_init_level();
-		delay_frame_time();
-		ship_x+=2;
-		ship_y++;
-	}
-
-	obj[0].x=MIN_X+((MAX_X-MIN_X)/2);
-	obj[0].y=global_pos-16; //1940-16; //112;
-	for(i=1;i<=lives;i++)
-		obj[i].x=obj[0].x;
-	hero.x=obj[0].x;
-
-	for(i=0;i<128;i++)
-	{
-		int n;
-		object *actual, *next;
-		draw_init_level();
-		delay_frame_time();
-		if (!(i%2))
-			obj[0].y++;
-		obj[0].img=IMG_PYRAMID0+((i%45)/15);
-		if (!(i%10))
-			dummy_move();
-		actual=(object *)&obj[0];
-		next=(object *)actual->next;
-		n=TILE_SIZE;
-		while(1)
-		{
-			if (i>n)
-				next->y=actual->y-TILE_SIZE;
-			else
-				break;
-			actual=next;
-			next=(object *)actual->next;
-			n+=(TILE_SIZE*2);
-			if (actual->obj_type==TYPE_HERO)
-			{
-				ship_y-=3;
-				ship_x+=2;
-				break;
-			}
-		}
-	}
-	stop_thrust();
-	ship_x=-2000;
-	ship_y=-2000;
-	play_sound(SND_ACTIVE);
-	hero.rot=6;
-	hero.vel=2;
-}
-
-static void end_level(void)
-{
-	int i,j,step=1+((MAX_Y+8)-hero.y)/20;
-
-	ship_x=-300;
-	ship_y=10;
-	play_thrust();
-	for(i=0;i<100;i++)
-	{
-		draw_init_level();
-		delay_frame_time();
-		ship_x+=2;
-		ship_y++;
-		j=1;
-		if (i>28)
-		{
-			while(obj[j].obj_type==TYPE_DUMMY)
-			{
-				obj[j].y--;
-				j++;
-			}
-			if (hero.x<64)
-				hero.x++;
-			else
-				if (hero.x>64)
-					hero.x--;
-			hero.y--;
-		}
-		else
-		{
-			if (hero.x<60 || hero.x>68)
-				if (hero.y<MAX_Y+8)
-					hero.y+=step;
-		}
-		if (!(i%10))
-			dummy_move();
-	}
-	for(i=0;i<100;i++)
-	{
-		if (i==70)
-			stop_thrust();
-		draw_init_level();
-		delay_frame_time();
-		ship_y-=3;
-		ship_x+=2;
-		if (!(i%10))
-			dummy_move();
-	}
-	music_stop_fade();
-	play_sound(SND_BOOM);
-	draw_end_level();
-	for(i=59;i>=0;i--)
-	{
-		draw_end_level_presentation(i, "IMPRESIONANTE");
-		delay_frame_time();
-		if (i==40)
-			play_sound(SND_AWESOME);
-	}
-	SDL_Delay(1500);
-	music_stop();
-}
-
-
-
-void init_frame_time(void)
-{
-	next_time=SDL_GetTicks()+FPS;
-}
-
-void delay_frame_time(void)
-{
-	Uint32 t=SDL_GetTicks();
-
-	if (t<next_time)
-	{
-		SDL_Delay(next_time-t);
-		next_time+=FPS;
-	}
-	else
-		next_time=t+FPS;
-}
-
-/*
-  FUNCION: process
-	Proceso general del juego
-*/
-void process()
-{
-	int i;
-
-	play_sound(SND_READY);
-	music_play_fade(MUSIC_LEVEL);
-	init_level();
-	init_frame_time();
-	theend=0;
-	completed=0;
-	while(!theend)
-	{
-		frame++;
-		
-		getKey();
-		real_process();
-		calcule_time();
-
-		draw();
-		delay_frame_time();
-	}
-	if(!completed)
-	{
-		music_stop_fade();
-		for(i=59;i>=0;i--)
-		{
-			draw_init_level_presentation(i, "FIN DEL JUEGO");
-			delay_frame_time();
-			if (i==40)
-				play_sound(SND_GAMEOVER);
-		}
-		SDL_Delay(1500);
-		music_stop();
-	}
-	else
-		end_level();
-}
-

File src/pyramid.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
- */
-
-/*
--------------------
-- Objeto Piramide -
--------------------
-*/
-
-
-/* Definiciones generales */
-#include "vorton.h"
-
-void pyramid_collision(object *this, object *other)
-{
-	other->push_y+=this->y - this->back_y;
-	this->y=this->back_y;
-}
-
-void pyramid_process(object *this)
-{
-	register int f=(frame%45) / 15;
-	this->img=IMG_PYRAMID0+f; //(f/15);
-	if (obj[1].obj_type==TYPE_DUMMY)
-	{
-		if (!(frame&0x1))
-		{
-			register int y=this->y;
-			register int hy=hero.y;
-			if ((hy>y-PYRAMID_VIEW)&&(hy<y+PYRAMID_VIEW))
-				this->y++;
-		}
-	}
-	else
-		this->y+=this->push_y;
-	if (this->y>MAX_Y)
-	{
-		hero.process=&bloq_process;
-		if (this->y>MAX_Y+32)
-		{
-			this->x=-2000;
-			global_pos=4096;
-			completed=1;
-			theend=1;
-		}
-		else
-			this->y+=2;
-		if (this->y<4096)
-			global_pos=this->y;
-	}
-
-}
-
-void pyramid_init(object *this)
-{
-	this->x=64;
-	this->y=64;
-	this->back_x=64;
-	this->back_y=64;
-	this->push_x=0;
-	this->push_y=0;
-	this->position=0;
-	this->obj_type=TYPE_PYRAMID;
-	this->img=IMG_PYRAMID0;
-	this->size_x=TILE_SIZE;
-	this->size_y=TILE_SIZE;
-	this->process=(void *)&pyramid_process;
-	this->collision=(void *)&pyramid_collision;
-}
-

File src/robot.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
- */
-
-/*
-----------------
-- Objeto Robot -
-----------------
-*/
-
-
-/* Definiciones generales */
-#include "vorton.h"
-
-#define FRAME_ROBOT 8
-#define MAX_ITER 8
-#define FREC_TRY 32
-#define MAX_ANIM 5
-
-/* Rutinas de Comprobaci�n de M�rgenes de Pista Gen�rica */
-
-/* Fecha Creaci�n: 	04/09/2003	*/
-/* Fecha URev:		05/09/2003	*/
-/* Par�metros: 		
- *		x:	Coordenada x del objeto		
- *		y:	Coordenada x del objeto		
- *
- * COMENTARIOS: Sin Optimizar		
- ***************************************************************/
-
-
-/* Rutina de C�lculo de trayectorias de objetos m�viles */
-
-/* Fecha Creaci�n: 	04/09/2003	*/
-/* Fecha URev:		22/10/2003	*/
-
-
-/* Par�metros: 		
-			tipo : 	Tipo de Trayectoria
-			0 Rectil�nea N-O
-			1 Rectil�nea O
-			2 Rectil�nea S-O               N
-			3 Rectil�nea S               O + E
-			4 Rectil�nea S-E	       S
-			5 Rectil�nea E
-			6 Rectil�nea N-E
-			7 Rectil�nea N
-			8 Rectilinea Persecuci�n			 
-			9 Aleatoria
-		       10 Cambio Trayectoria cada cierto tiempo aleatorio
-		       11 Cambio de trayectoria cada cierto tiempo fijo	
-			
-*		x:	Coordenada x del objeto		
-*		y:	Coordenada x del objeto		
-*		vel:	Velocidad del objeto		
-*
-* COMENTARIOS:	No Optimizada	
-*		Esta rutina tiene la limitaci�n que las trayectorias con memoria (aleatoria) son comunes
-*		para todos los objetos que posean este tipo, es decir, cuando cambia la try , cambia para todos
-*		los objetos de ese tipo.
-*		Una soluci�n consiste en incluir los vectores de direcci�n a cada objeto m�vil en su estructura
-*		Un dise�o h�bil de niveles puede ocultar este efecto.
-***************************************************************/
-
-
-//static inline void trayectoria(int obj_id, int *tipo,int *x,int *y,int vel)
-static inline void trayectoria(object *this)
-{  /* Begin trayectoria */
-
-	/* Selecci�n y C�lculo de la trayectoria */
-	int vel = this->vel;
-		
-	switch(this->move_type)
-		{
-			case 0:
-				this->x-=vel;
-				this->y+=vel;
-				break;
-			case 1:
-				this->x-=vel;
-				break;
-			case 2:
-				this->x-=vel;
-				this->y-=vel;
-				break;
-			case 3:
-				this->y-=vel;
-				break;
-			case 4:
-				this->x+=vel;
-				this->y-=vel;
-				break;
-			case 5:
-				this->x+=vel;
-				break;
-			case 6:
-				this->x+=vel;
-				this->y+=vel;
-				break;
-			case 7:		
-				this->y+=vel;
-				break;
-			case 8:		
-