File: bonus.cc

package info (click to toggle)
pacman 10-13
  • links: PTS
  • area: main
  • in suites: woody
  • size: 664 kB
  • ctags: 1,108
  • sloc: cpp: 3,333; makefile: 502; sh: 96
file content (23 lines) | stat: -rw-r--r-- 461 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include"bonus.h"
#include"pac.h"

void Bonus::getxy(int *xx,int *yy) {	//get it's coordinates 
*xx=x; *yy=y; }

Bonus::Bonus() {			//constructor
 x=BONUSX; y=BONUSY; 			//just set the coordinates
}

Bonus::~Bonus() {			//destructor
delete g;
}

int Bonus::code() {			//code to be done while it exists
return lifetime--;			//just countdown the lifetime
}

void Bonus::start() {			//reset the bonus
 lifetime=BONUSTIME; 			//set lifetime to a certain amount
}