CRisingPoints.cpp 784 Bytes
Newer Older
1 2 3 4 5 6
/*
 * gotpoints.cpp
 *
 *  Created on: 23.08.2009
 *      Author: gerstrong
 */
7
#include "CRisingPoints.h"
8
#include "graphics/GsGraphics.h"
9 10 11 12 13 14 15

// GotPoints object (rising numbers when you get a bonus item)
// (this wasn't in original Keen)

#define GOTPOINTS_SPEED         16
#define GOTPOINTS_LIFETIME      25

Gerhard Stein's avatar
Gerhard Stein committed
16
CRisingPoints::CRisingPoints(CMap *p_map, Uint32 x, Uint32 y) :
Gerhard Stein's avatar
Gerhard Stein committed
17
CVorticonSpriteObject(p_map, x, y, OBJ_GOTPOINTS)
18
{
19 20 21 22
	offscreentime = GOTPOINTS_LIFETIME;
	inhibitfall = true;
	solid = false;
	honorPriority = false;
23 24
}

25

26
void CRisingPoints::process()
27
{
28
	moveUp(GOTPOINTS_SPEED);
29 30

	// delete it after it's existed for a certain amount of time
31
	if (!offscreentime)
32
	{
Gerstrong's avatar
Gerstrong committed
33 34 35 36 37 38 39
		transluceny+=10;

		if(transluceny >= 250)
		{
			exists = false;
			return;
		}
40
	}
41
	else offscreentime--;
42
}