Added MachineGunDroid.
This commit is contained in:
parent
32109cbc15
commit
0197bcd5fa
|
@ -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 += cJSON.o
|
||||||
_OBJS += key.o keycard.o
|
_OBJS += key.o keycard.o
|
||||||
_OBJS += laser.o laserTrap.o lift.o lookup.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 += objectives.o
|
||||||
_OBJS += particles.o player.o pistolBlob.o pistolDroid.o powerPoint.o powerPool.o pressurePlate.o pushBlock.o
|
_OBJS += particles.o player.o pistolBlob.o pistolDroid.o powerPoint.o powerPool.o pressurePlate.o pushBlock.o
|
||||||
_OBJS += quadtree.o
|
_OBJS += quadtree.o
|
||||||
|
|
|
@ -38,6 +38,7 @@ void initEntityFactory(void)
|
||||||
addEntityDef("GenericEvilBlob", initGenericEvilBlob);
|
addEntityDef("GenericEvilBlob", initGenericEvilBlob);
|
||||||
addEntityDef("GenericEyeDroid", initGenericEyeDroid);
|
addEntityDef("GenericEyeDroid", initGenericEyeDroid);
|
||||||
addEntityDef("MachineGunBlob", initMachineGunBlob);
|
addEntityDef("MachineGunBlob", initMachineGunBlob);
|
||||||
|
addEntityDef("MachineGunEyeDroid", initMachineGunDroid);
|
||||||
addEntityDef("GrenadeBlob", initGrenadeBlob);
|
addEntityDef("GrenadeBlob", initGrenadeBlob);
|
||||||
addEntityDef("GrenadeEyeDroid", initGrenadeDroid);
|
addEntityDef("GrenadeEyeDroid", initGrenadeDroid);
|
||||||
addEntityDef("ShotgunBlob", initShotgunBlob);
|
addEntityDef("ShotgunBlob", initShotgunBlob);
|
||||||
|
|
|
@ -56,5 +56,6 @@ extern Entity *initRedKeycard(void);
|
||||||
extern Entity *initYellowKeycard(void);
|
extern Entity *initYellowKeycard(void);
|
||||||
extern Entity *initLaserTrap(void);
|
extern Entity *initLaserTrap(void);
|
||||||
extern Entity *initHorizontalLaserTrap(void);
|
extern Entity *initHorizontalLaserTrap(void);
|
||||||
|
extern Entity *initMachineGunDroid(void);
|
||||||
|
|
||||||
extern World world;
|
extern World world;
|
||||||
|
|
|
@ -22,9 +22,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
static int canFire(Entity *target);
|
static int canFire(Entity *target);
|
||||||
|
|
||||||
void initMachineGunDroid(Unit *u)
|
Entity *initMachineGunDroid(void)
|
||||||
{
|
{
|
||||||
|
Unit *u;
|
||||||
|
|
||||||
|
u = createUnit();
|
||||||
|
|
||||||
initEyeDroid(u);
|
initEyeDroid(u);
|
||||||
|
|
||||||
|
u->unitType = "MachineGunEyeDroid";
|
||||||
|
|
||||||
u->sprite[FACING_LEFT] = getSprite("MachineGunDroidLeft");
|
u->sprite[FACING_LEFT] = getSprite("MachineGunDroidLeft");
|
||||||
u->sprite[FACING_RIGHT] = getSprite("MachineGunDroidRight");
|
u->sprite[FACING_RIGHT] = getSprite("MachineGunDroidRight");
|
||||||
|
@ -35,6 +41,8 @@ void initMachineGunDroid(Unit *u)
|
||||||
u->maxShotsToFire = 5;
|
u->maxShotsToFire = 5;
|
||||||
|
|
||||||
u->canFire = canFire;
|
u->canFire = canFire;
|
||||||
|
|
||||||
|
return (Entity*)u;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int canFire(Entity *target)
|
static int canFire(Entity *target)
|
||||||
|
|
|
@ -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;
|
|
@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
void initAtlasTest(void)
|
void initAtlasTest(void)
|
||||||
{
|
{
|
||||||
dev.cheatNoEnemies = 1;
|
dev.cheatNoEnemies = 0;
|
||||||
dev.cheatKeys = 1;
|
dev.cheatKeys = 1;
|
||||||
dev.cheatPower = 1;
|
dev.cheatPower = 1;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ void initAtlasTest(void)
|
||||||
|
|
||||||
initHub();
|
initHub();
|
||||||
|
|
||||||
loadWorld("data/maps/beachFront2.json");
|
loadWorld("data/maps/beachFront3.json");
|
||||||
|
|
||||||
initWorld();
|
initWorld();
|
||||||
|
|
||||||
|
|
|
@ -87,10 +87,6 @@ void initWorld(void)
|
||||||
|
|
||||||
app.delegate.logic = logic;
|
app.delegate.logic = logic;
|
||||||
app.delegate.draw = draw;
|
app.delegate.draw = draw;
|
||||||
|
|
||||||
startMission();
|
|
||||||
world.bob->x = 140 * MAP_TILE_SIZE;
|
|
||||||
world.bob->y = 106 * MAP_TILE_SIZE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void logic(void)
|
static void logic(void)
|
||||||
|
@ -379,7 +375,7 @@ static void doCommon(void)
|
||||||
animateSprites();
|
animateSprites();
|
||||||
|
|
||||||
world.frameCounter++;
|
world.frameCounter++;
|
||||||
world.frameCounter %= 4096;
|
world.frameCounter %= (FPS * 10);
|
||||||
|
|
||||||
doHud();
|
doHud();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue