Added MachineGunDroid.

This commit is contained in:
Steve 2018-02-09 22:41:37 +00:00
parent 32109cbc15
commit 0197bcd5fa
7 changed files with 42 additions and 9 deletions

View File

@ -42,7 +42,7 @@ _OBJS += i18n.o init.o infoPoint.o input.o io.o item.o items.o itemPad.o
_OBJS += cJSON.o
_OBJS += key.o keycard.o
_OBJS += laser.o laserTrap.o lift.o lookup.o
_OBJS += machineGunBlob.o main.o map.o maths.o mia.o missile.o
_OBJS += machineGunBlob.o machineGunDroid.o main.o map.o maths.o mia.o missile.o
_OBJS += objectives.o
_OBJS += particles.o player.o pistolBlob.o pistolDroid.o powerPoint.o powerPool.o pressurePlate.o pushBlock.o
_OBJS += quadtree.o

View File

@ -38,6 +38,7 @@ void initEntityFactory(void)
addEntityDef("GenericEvilBlob", initGenericEvilBlob);
addEntityDef("GenericEyeDroid", initGenericEyeDroid);
addEntityDef("MachineGunBlob", initMachineGunBlob);
addEntityDef("MachineGunEyeDroid", initMachineGunDroid);
addEntityDef("GrenadeBlob", initGrenadeBlob);
addEntityDef("GrenadeEyeDroid", initGrenadeDroid);
addEntityDef("ShotgunBlob", initShotgunBlob);

View File

@ -56,5 +56,6 @@ extern Entity *initRedKeycard(void);
extern Entity *initYellowKeycard(void);
extern Entity *initLaserTrap(void);
extern Entity *initHorizontalLaserTrap(void);
extern Entity *initMachineGunDroid(void);
extern World world;

View File

@ -22,9 +22,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static int canFire(Entity *target);
void initMachineGunDroid(Unit *u)
Entity *initMachineGunDroid(void)
{
Unit *u;
u = createUnit();
initEyeDroid(u);
u->unitType = "MachineGunEyeDroid";
u->sprite[FACING_LEFT] = getSprite("MachineGunDroidLeft");
u->sprite[FACING_RIGHT] = getSprite("MachineGunDroidRight");
@ -35,6 +41,8 @@ void initMachineGunDroid(Unit *u)
u->maxShotsToFire = 5;
u->canFire = canFire;
return (Entity*)u;
}
static int canFire(Entity *target)

View File

@ -0,0 +1,27 @@
/*
Copyright (C) 2018 Parallel Realities
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 "../../common.h"
extern Unit *createUnit(void);
extern void initEyeDroid(Unit *u);
extern Sprite *getSprite(char *name);
extern Entity *self;

View File

@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void initAtlasTest(void)
{
dev.cheatNoEnemies = 1;
dev.cheatNoEnemies = 0;
dev.cheatKeys = 1;
dev.cheatPower = 1;
@ -30,7 +30,7 @@ void initAtlasTest(void)
initHub();
loadWorld("data/maps/beachFront2.json");
loadWorld("data/maps/beachFront3.json");
initWorld();

View File

@ -87,10 +87,6 @@ void initWorld(void)
app.delegate.logic = logic;
app.delegate.draw = draw;
startMission();
world.bob->x = 140 * MAP_TILE_SIZE;
world.bob->y = 106 * MAP_TILE_SIZE;
}
static void logic(void)
@ -379,7 +375,7 @@ static void doCommon(void)
animateSprites();
world.frameCounter++;
world.frameCounter %= 4096;
world.frameCounter %= (FPS * 10);
doHud();