File: explosion.h

package info (click to toggle)
xgalaga%2B%2B 0.9-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 376 kB
  • sloc: cpp: 2,785; makefile: 242
file content (24 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef EXPLOSION_H
#define EXPLOSION_H

#include "gfxinterface.h"
#include <vector>


// An explosion is made of moving, color changing, dots.
class Explosion {
	XColor color_;
	int moves_;
	const int duration_;
	typedef std::vector<Coord> dotsCtn;
	dotsCtn dots_, dots_speed_;
public:
	Explosion(Coord pos, Coord speed, XColor color, int duration = 24);
	void Move();
	bool Finished() const { return moves_ >= duration_; }
private:
	void DrawAll(X11::Color color) const;
};


#endif