-
Notifications
You must be signed in to change notification settings - Fork 0
/
greenmush.cpp
35 lines (30 loc) · 1.17 KB
/
greenmush.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "greenmush.h"
/* Constructor for a green mushroom sets velocity to 0, sets the check off status to true
@param pm Pixmap pointer to show picture
@param nx Initial x cooridinate to set position
@param ny Initial y coordinate to set poition **/
GreenMush:: GreenMush(QPixmap *pm, int nx, int ny) : Thing(pm,nx,ny)
{
*pm = pm->scaled(50, 50, Qt::KeepAspectRatio);
vX = 0;
vY = 0;
}
/* Default destructor **/
GreenMush:: ~GreenMush()
{}
/* Sets the X variable of the item
@return A boolean for the state of the checker **/
bool GreenMush:: getCheck()
{
return goodCheck;
}
/* Sets the check off status for the mushroom, this is needed because when the mushroom is deleted the checker is set to false, so the mushroom is not deleted more that once off the scene.
@param checker the checker that is inside the MainWindow **/
void GreenMush:: setCheck(bool checker)
{
goodCheck = checker;
}
/* The green mushroom does not implement a move function, but derives from class thing which as a pure virtual move function **/
void GreenMush:: move() {}
/* @return 4-- tells switch in MainWindow to execute mushroom collision **/
int GreenMush :: executePower() {return 4;}