Commit 49bfca52 authored by Gerhard Stein's avatar Gerhard Stein

fixes

parent 62e6d938
......@@ -17,7 +17,6 @@ public:
void reset();
private:
int m_lifes;
int m_points;
int m_lifeAt;
......
......@@ -125,7 +125,6 @@ void CPlayGameGalaxy::processInput()
mp_Menu = new CMenuGalaxy(ACTIVE, m_ExeFile, m_SavedGame, mp_option, m_restartVideo);
m_BackgroundBitmap = *g_pGfxEngine->getBitmap("KEENSWATCH");
}
}
/*
......
......@@ -40,7 +40,7 @@ void CWorldMap::init()
CMapLoaderGalaxy MapLoader(m_ExeFile, m_ObjectPtr, m_Inventory);
m_Map.setScrollSurface(g_pVideoDriver->getScrollSurface());
MapLoader.loadMap(m_Map, 0); // Map Level?
MapLoader.loadMap(m_Map, 0); // Is it a Map Level?
m_Map.drawAll();
}
......
......@@ -50,6 +50,8 @@ m_Inventory(l_Inventory)
m_pfiring = false;
m_jumpheight = 0;
m_climbing = false;
m_inair = false;
processActionRoutine();
CSprite &rSprite = g_pGfxEngine->getSprite(sprite);
......@@ -677,6 +679,17 @@ void CPlayerLevel::processLevelMiscFlagsCheck()
if( hitdetectWithTileProperty(i, l_x, l_y) )
{
if(i == 7 && m_Inventory.m_gem.red > 0)
m_Inventory.m_gem.red--;
else if(i == 8 && m_Inventory.m_gem.yellow > 0)
m_Inventory.m_gem.yellow--;
else if(i == 9 && m_Inventory.m_gem.blue > 0)
m_Inventory.m_gem.blue--;
else if(i == 10 && m_Inventory.m_gem.green > 0)
m_Inventory.m_gem.green--;
else
break;
setAction(A_KEEN_SLIDE);
}
}
......
......@@ -76,6 +76,8 @@ public:
void openDoorsTile();
void processPlaceGem();
CInventory &m_Inventory;
private:
Uint8 m_animation;
Uint8 m_animation_time;
......@@ -91,8 +93,6 @@ private:
int m_timer;
CInventory &m_Inventory;
};
}
......
......@@ -7,6 +7,7 @@
#include "CSpriteItem.h"
#include "CItemEffect.h"
#include "CPlayerLevel.h"
namespace galaxy {
......@@ -47,6 +48,9 @@ void CSpriteItem::getTouchedBy(CObject &theObject)
{
exists = false;
//CPlayerLevel &Player = dynamic_cast<CPlayerLevel&>(theObject);
CPlayerLevel *pPlayer = (CPlayerLevel*)(&theObject);
Uint32 newanimsprite = got_sprite_item_pics[0];
/// Calculate the right animation.
// Point items
......@@ -58,6 +62,27 @@ void CSpriteItem::getTouchedBy(CObject &theObject)
newanimsprite = got_sprite_item_pics[11];
m_ObjectPtrs.push_back(new CItemEffect(mp_Map, getXPosition(), getYPosition(), newanimsprite));
// Now add the stuff to the inventory
switch(m_basesprite)
{
case 118:
pPlayer->m_Inventory.m_gem.red++;
break;
case 120:
pPlayer->m_Inventory.m_gem.yellow++;
break;
case 122:
pPlayer->m_Inventory.m_gem.blue++;
break;
case 124:
pPlayer->m_Inventory.m_gem.green++;
break;
default:
break;
}
}
}
......
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