~kubuntu-members/kapman/4.11

68 by Thomas Gallinari
- Improving about dialog
1
/*
102 by Thomas Gallinari
A piece of refactoring and a bug fixing due to a bad pause management
2
 * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
46 by Thomas Gallinari
Modifying copyright headers
3
 * Copyright 2007-2008 Gaƫl Courcelle <gael.courcelle@gmail.com>
4
 * Copyright 2007-2008 Alexia Allanic <alexia_allanic@yahoo.fr>
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License as
8
 * published by the Free Software Foundation; either version 2 of 
9
 * the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 */
41 by Johann Hingue
Display Pills & Energizers
19
20
#include "energizer.h"
44 by Johann Hingue
DoActionCoolision implements for each elements
21
#include "kapman.h"
41 by Johann Hingue
Display Pills & Energizers
22
54 by Thomas Gallinari
- For each 10,000 points we get one more life
23
const int Energizer::POINTS = 50;
41 by Johann Hingue
Display Pills & Energizers
24
125 by Pierre-Benoit Besse
- All images are now in a single SVG file
25
Energizer::Energizer(qreal p_x, qreal p_y, Maze* p_maze, const QString& p_imageId) :  Element(p_x, p_y, p_maze) {
26
	Element::setImageId(p_imageId);
251 by Albert Astals Cid
add two const and use the proper value instead a hardcoded 50
27
	m_points = Energizer::POINTS;
55 by Pierre-Benoit Besse
- Some memory leaks and bad comments corrected
28
	m_type = Element::ENERGYZER;
41 by Johann Hingue
Display Pills & Energizers
29
}
30
31
Energizer::~Energizer() {
32
}
33
34
void Energizer::doActionOnCollision(Kapman* p_kapman) {
55 by Pierre-Benoit Besse
- Some memory leaks and bad comments corrected
35
	p_kapman->winPoints(this);
51 by Thomas Gallinari
-Managing levels :
36
	// Tell to the maze that an element was eaten
37
	m_maze->decrementNbElem();
41 by Johann Hingue
Display Pills & Energizers
38
}
39