J :
* Shift mana to the bottom of the screen to make them easier to count.
This commit is contained in:
@@ -24,7 +24,7 @@ class ManaIcon : public Pos
|
||||
enum { ALIVE, WITHERING, DROPPING, DEAD } mode;
|
||||
int color;
|
||||
void Render();
|
||||
void Update(float dt);
|
||||
void Update(float dt, float shift);
|
||||
void Wither();
|
||||
void Drop();
|
||||
ManaIcon(int color, float x, float y);
|
||||
|
||||
@@ -138,7 +138,7 @@ void ManaIcon::Render()
|
||||
renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA);
|
||||
renderer->RenderQuad(icon, actX, actY, actT, actZ + zoomP1 * sinf(M_PI * zoomP3), actZ + zoomP2 * cosf(M_PI * zoomP4));
|
||||
}
|
||||
void ManaIcon::Update(float dt)
|
||||
void ManaIcon::Update(float dt, float shift)
|
||||
{
|
||||
xP1 += xP3 * dt;
|
||||
actX = x + xP2 * sinf(M_PI * xP1);
|
||||
@@ -163,7 +163,7 @@ void ManaIcon::Update(float dt)
|
||||
break;
|
||||
case ALIVE :
|
||||
x += 10 * dt * (DESTX - x);
|
||||
y += 10 * dt * (DESTY - y);
|
||||
y += 10 * dt * (DESTY + shift - y);
|
||||
yP1 += yP3 * dt;
|
||||
actY = y + yP2 * sinf(M_PI * yP1);
|
||||
break;
|
||||
@@ -200,6 +200,7 @@ GuiMana::~GuiMana(){
|
||||
|
||||
void GuiMana::Render()
|
||||
{
|
||||
|
||||
for (vector<ManaIcon*>::iterator it = manas.begin(); it != manas.end(); ++it)
|
||||
(*it)->Render();
|
||||
}
|
||||
@@ -207,8 +208,9 @@ bool remove_dead(ManaIcon* m) { return ManaIcon::DEAD != m->mode; }
|
||||
void GuiMana::Update(float dt)
|
||||
{
|
||||
{
|
||||
float shift = 0;
|
||||
for (vector<ManaIcon*>::iterator it = manas.begin(); it != manas.end(); ++it)
|
||||
(*it)->Update(dt);
|
||||
{ (*it)->Update(dt, shift); shift += 15; }
|
||||
}
|
||||
vector<ManaIcon*>::iterator it = partition(manas.begin(), manas.end(), &remove_dead);
|
||||
if (it != manas.end())
|
||||
|
||||
Reference in New Issue
Block a user