-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSegment.h
More file actions
34 lines (32 loc) · 705 Bytes
/
Segment.h
File metadata and controls
34 lines (32 loc) · 705 Bytes
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
/*
* Segment.h
*
* Created on: Apr 29, 2019
* Author: zohair
*/
#ifndef SEGMENT_H_
#define SEGMENT_H_
#include"MoveableObject.h"
class Segment :public MoveableObject{
protected:
bool inPlayerArea;
public:
char verticalDirection;
Segment();
virtual void draw()=0;
virtual void move()=0;
virtual int getObjectPositionX()=0;
virtual int getObjectPositionY()=0;
virtual void changeDirection();
void changeVerticle(){
if(verticalDirection=='d'){
this->objectPosition.setObjY(objectPosition.getObjY()-1);
}
else{
this->objectPosition.setObjY(objectPosition.getObjY()+1);
}
}
void setVDrirection(char c){verticalDirection=c;}
virtual ~Segment();
};
#endif /* SEGMENT_H_ */