Commit fcbd7320 authored by Gerhard Stein's avatar Gerhard Stein

Added hatching Egg

parent 89fd8b7a
......@@ -424,6 +424,13 @@ CGalaxySpriteObject* CMapLoaderGalaxy::addFoe(CMap &Map, word foe, size_t x, siz
p_newfoe = new galaxy::CBounder(&Map, foe, x, y-250);
break;
/*case 13:
// I think this is an egg
// TODO: Those relative coordinates are not a good sign. Try to remove them and make the Sprite substract them
p_newfoe = new galaxy::CBounder(&Map, foe, x, y-250);
break;*/
case 19:
//This is a Mimrock.
// TODO: Those relative coordinates are not a good sign. Try to remove them and make the Sprite substract them
......
/*
* CEgg.cpp
*
* Created on: 10.07.2012
* Author: gerstong
*/
#include "CEgg.h"
#include "engine/galaxy/ai/CPlayerLevel.h"
#include "engine/galaxy/ai/CBullet.h"
namespace galaxy {
CEgg::CEgg(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) :
CGalaxySpriteObject(pmap, foeID, x, y)
{}
void CEgg::hatch()
{
}
void CEgg::getTouchedBy(CSpriteObject &theObject)
{
if(theObject.dead )
return;
if( CBullet *bullet = dynamic_cast<CBullet*>(&theObject) )
{
bullet->setAction(A_KEENSHOT_IMPACT);
bullet->playSound( SOUND_SHOT_HIT );
bullet->dead = true;
hatch();
}
if( CPlayerBase *player = dynamic_cast<CPlayerBase*>(&theObject) )
{
hatch();
}
}
} /* namespace galaxy */
/*
* CEgg.h
*
* Created on: 10.07.2012
* Author: gerstong
*
* It processes the egg just laying there
*/
#include "engine/galaxy/CGalaxySpriteObject.h"
#ifndef CEGG_H_
#define CEGG_H_
#include "engine/galaxy/CGalaxySpriteObject.h"
namespace galaxy
{
class CEgg : public CGalaxySpriteObject
{
public:
CEgg(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y);
void hatch();
void getTouchedBy(CSpriteObject &theObject);
};
} /* namespace galaxy */
#endif /* CEGG_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