Commit fcd7ae37 authored by Gerhard Stein's avatar Gerhard Stein

Leaving level message is there

parent 19b01736
......@@ -46,6 +46,8 @@
#include "engine/galaxy/ai/CSpriteItem.h"
#include "engine/galaxy/ai/platforms.h"
#include "engine/galaxy/ai/CFlag.h"
#include <fstream>
namespace galaxy
......@@ -347,14 +349,14 @@ void CMapLoaderGalaxy::spawnFoes(CMap &Map)
// 31 seem to be the stoppers, those are not created because the platform
// get this from the object map directly
const int PLATFORM_VERT_ALT = 27;
const int PLATFORM_HORIZ_ALT = 28;
const int PLATFORM_VERT = 29;
const int PLATFORM_HORIZ = 30;
const unsigned int PLATFORM_VERT_ALT = 27;
const unsigned int PLATFORM_HORIZ_ALT = 28;
const unsigned int PLATFORM_VERT = 29;
const unsigned int PLATFORM_HORIZ = 30;
// 31 does not count, because it's a blocker.
const int PLATFORM_DROP = 32;
const unsigned int PLATFORM_DROP = 32;
const int DIVE_SUIT = 35;
const unsigned int DIVE_SUIT = 35;
/**
* @brief Loads a foe given by the coordiantes
*/
......@@ -387,6 +389,7 @@ void CMapLoaderGalaxy::addFoe(CMap &Map, word foe, size_t x, size_t y)
}
}
VectorD2<Uint32> loc(x,y);
switch(foe)
{
......@@ -497,6 +500,10 @@ void CMapLoaderGalaxy::addFoe(CMap &Map, word foe, size_t x, size_t y)
p_newfoe = new galaxy::CDopeFish(&Map, foe, x, y);
break;
case CFlag::FOE_ID:
p_newfoe = new galaxy::CFlag(&Map, loc, loc);
break;
default:
break;
......
......@@ -16,7 +16,6 @@
#include "fileio/CExeFile.h"
#include "engine/galaxy/CInventory.h"
#include "engine/galaxy/CGalaxySpriteObject.h"
#include "engine/galaxy/dialog/CMessageBoxGalaxy.h"
#include "common/CBehaviorEngine.h"
#include "CMapLoaderGalaxy.h"
#include "sdl/input/CInput.h"
......
......@@ -8,6 +8,7 @@
#include "CFlag.h"
#include "sdl/sound/CSound.h"
namespace galaxy {
const Uint16 FLYING_BASEFRAME = 174;
......@@ -16,9 +17,9 @@ const Uint16 WAVING_BASEFRAME = 181;
const Uint16 ANIMATION_TIME = 8;
const Uint16 SPEED = 64;
CFlag::CFlag(CMap *pmap, const Uint16 foeID, const VectorD2<Uint32> &Location,
CFlag::CFlag(CMap *pmap, const VectorD2<Uint32> &Location,
const VectorD2<Uint32> &Destination) :
CGalaxySpriteObject(pmap, foeID, Location.x, Location.y),
CGalaxySpriteObject(pmap, FOE_ID, Location.x, Location.y),
m_location(Location),
m_destination(Destination),
m_baseframe(FLYING_BASEFRAME),
......
......@@ -19,7 +19,9 @@ namespace galaxy {
class CFlag : public CGalaxySpriteObject
{
public:
CFlag(CMap *pmap, const Uint16 foeID, const VectorD2<Uint32> &Location,
static const unsigned int FOE_ID = 500;
CFlag(CMap *pmap, const VectorD2<Uint32> &Location,
const VectorD2<Uint32> &Destination);
// The flag is flying when player throws it.
......
......@@ -64,6 +64,8 @@ void CPlayerWM::process()
if(ev->sucess)
{
finishLevel(ev->levelObject);
const std::string loading_text = g_pBehaviorEngine->getString("WORLDMAP_LOAD_TEXT");
EventContainer.add( new EventSendBitmapDialogMsg(106, loading_text, LEFT) );
}
EventContainer.pop_Event();
}
......@@ -212,7 +214,7 @@ void CPlayerWM::finishLevel(Uint16 object)
VectorD2<Uint32> src(getXPosition(), getYPosition());
VectorD2<Uint32> dst((x<<CSF), (y<<CSF));
CFlag *pFlag = new CFlag(mp_Map, 0, src, dst);
CFlag *pFlag = new CFlag(mp_Map, src, dst);
m_ObjectPtrs.push_back(pFlag);
g_pSound->playSound( SOUND_FLAG_APPEAR );
......
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