Commit 7e7d4a36 authored by Gerstrong's avatar Gerstrong

Slug slime is now generated

parent 23fe63f0
......@@ -399,7 +399,7 @@ void CMapLoaderGalaxy::addFoe(CMap &Map, word foe, size_t x, size_t y)
case 22:
//This is a Poison Slug.
p_newfoe = new galaxy::CPoisonSlug(&Map, x, y-250);
p_newfoe = new galaxy::CPoisonSlug(&Map, x, y-250, m_ObjectPtr);
break;
case PLATFORM_VERT: case PLATFORM_VERT_ALT:
......
......@@ -6,6 +6,7 @@
*/
#include "CPoisonSlug.h"
#include "CSlugSlime.h"
#include "misc.h"
namespace galaxy {
......@@ -14,14 +15,16 @@ namespace galaxy {
const int SLUG_MOVE_SPEED = 1;
const int SLUG_MOVE_TIMER = 10;
CPoisonSlug::CPoisonSlug(CMap *pmap, Uint32 x, Uint32 y) :
CPoisonSlug::CPoisonSlug(CMap *pmap, Uint32 x, Uint32 y,
std::vector<CObject*>&ObjectPtrs) :
CObject(pmap, x, y, OBJ_NONE),
m_ObjectPtrs(ObjectPtrs),
m_timer(0)
{
m_ActionBaseOffset = 0x2012;
m_hDir = LEFT;
setActionForce(A_SLUG_MOVE);
mp_processState = &CPoisonSlug::processCrawling;
m_hDir = LEFT;
processActionRoutine();
performCollisions();
}
......@@ -56,6 +59,7 @@ void CPoisonSlug::processCrawling()
m_timer = 0;
mp_processState = &CPoisonSlug::processPooing;
setAction(A_SLUG_POOING);
m_ObjectPtrs.push_back(new CSlugSlime(mp_Map, getXLeftPos(), getYDownPos()-(8<<STC)));
return;
}
......@@ -75,7 +79,6 @@ void CPoisonSlug::processPooing()
{
if( getActionStatus(A_SLUG_MOVE) )
{
// TODO: Create that slime
setAction(A_SLUG_MOVE);
mp_processState = &CPoisonSlug::processCrawling;
}
......
......@@ -10,6 +10,7 @@
#ifndef CPOISONSLUG_H_
#define CPOISONSLUG_H_
#include <vector>
#include "common/CObject.h"
namespace galaxy {
......@@ -21,7 +22,8 @@ namespace galaxy {
class CPoisonSlug : public CObject {
public:
CPoisonSlug(CMap *pmap, Uint32 x, Uint32 y);
CPoisonSlug(CMap *pmap, Uint32 x, Uint32 y,
std::vector<CObject*>&ObjectPtrs);
/**
* When slug is moving normally
......@@ -37,6 +39,7 @@ public:
void process();
private:
std::vector<CObject*>& m_ObjectPtrs;
int m_timer;
void (CPoisonSlug::*mp_processState)();
};
......
......@@ -7,10 +7,21 @@
#include "CSlugSlime.h"
const int A_SLUGPOISON_NORMAL = 0;
const int A_SLUGPOISON_FADE = 1;
CSlugSlime::CSlugSlime(CMap *pmap, Uint32 x, Uint32 y) :
CObject(pmap, x, y, OBJ_NONE)
{
// TODO Auto-generated constructor stub
m_ActionBaseOffset = 0x20A8;
setActionForce(A_SLUGPOISON_NORMAL);
processActionRoutine();
performCollisions();
}
void CSlugSlime::process()
{
processFalling();
processActionRoutine();
}
......@@ -3,6 +3,9 @@
*
* Created on: 28.05.2011
* Author: gerstrong
*
* This header handles the slug poo. It just shows it and make it disappear
* In this time it is lethal of course.
*/
#ifndef CSLUGSLIME_H_
......@@ -12,8 +15,12 @@
class CSlugSlime : public CObject {
public:
/** Standard Constructor for the slug poo */
CSlugSlime(CMap *pmap, Uint32 x, Uint32 y);
/** Main Process cycle */
void process();
};
#endif /* CSLUGSLIME_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment