home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 July & August
/
PCWorld_2006-07-08_cd.bin
/
temacd
/
planearcade
/
planearcade.exe
/
Tank3.bmp
/
score.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2004-05-08
|
2KB
|
98 lines
#include "main.h"
//-----------
//Globals
//-----------
SCORE Score;
//inicializacia
//-------------------------------------------------------------
void SCORE::Initialize()
{
Panel.Create(64,32,10);
Panel.AddFrame("menu/score/10.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
Panel.AddFrame("menu/score/20.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
Panel.AddFrame("menu/score/30.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
Panel.AddFrame("menu/score/40.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
Panel.AddFrame("menu/score/50.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
Panel.AddFrame("menu/score/60.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
Panel.AddFrame("menu/score/70.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
Panel.AddFrame("menu/score/80.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
Panel.AddFrame("menu/score/90.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
Panel.AddFrame("menu/score/100.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
Reset();
}
//reset
//-------------------------------------------------------------
void SCORE::Reset()
{
for (int i=0;i<Score_Max_Captions;i++)
{
Caption[i].Active = false;
Caption[i].Time = 0.0f;
}
}
//refresh
//-------------------------------------------------------------
void SCORE::Refresh()
{
for (int i=0;i<Score_Max_Captions;i++)
{
if(Caption[i].Active == false)
continue;
//process
Caption[i].Pos.Y += Power(1.0f);
//render
VECTOR3D ScreenPos = Project(Caption[i].Pos);
Engine.SetBlendTrans();
Panel.Color.A = 1.0f - (Caption[i].Time/Score_Time);
Panel.Pos = ScreenPos;
Panel.Frame = ((float)Caption[i].Value) - 1.0f;
Panel.Render();
Engine.SetBlendNone();
//time
Caption[i].Time += PowerTime(1.0f);
if (Caption[i].Time > Score_Time)
{
Caption[i].Time = 0.0f;
Caption[i].Active = false;
}
}
}
//pridaj napis
//-------------------------------------------------------------
void SCORE::DrawScore(int Value, VECTOR3D Pos)
{
for (int i=0;i<Score_Max_Captions;i++)
{
if(Caption[i].Active == true)
continue;
//time
Caption[i].Time = 0.0f;
Caption[i].Value = Value/100;
Caption[i].Pos = Pos;
Caption[i].Active = true;
break;
}
}
//
//-------------------------------------------------------------