-
Notifications
You must be signed in to change notification settings - Fork 0
/
Enemy.cpp
46 lines (37 loc) · 848 Bytes
/
Enemy.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
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "Enemy.h"
#include <iostream>
Enemy::Enemy()
{
xdir = 1; // how far it moves for each time out
ydir = 0;
}
Enemy::~Enemy() {//destructor.
}
void Enemy::movePositioning(int xcoordinate, int ycoordinate)//moves the var to this X and Y coordinate in the window.
{
rect.moveTo(xcoordinate,ycoordinate);
}
void Enemy::moveBottom(int bottom)//move one step down.
{
rect.moveBottom(bottom);
}
void Enemy::moveTop(int top)//move one step up.
{
rect.moveTop(top);
}
void Enemy::moveLeft(int left)//move one step to left.
{
rect.moveLeft(left);
}
void Enemy::moveRight(int right)//move to right.
{
rect.moveRight(right);
}
QRect Enemy::getRect()//returns the rectangle type.
{
return rect;
}
QImage & Enemy::getImage()//sets the image as the rectangle.
{
return image;
}