-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObstacle.h
More file actions
38 lines (31 loc) · 715 Bytes
/
Obstacle.h
File metadata and controls
38 lines (31 loc) · 715 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
35
36
37
38
#ifndef OBSTACLE_H
#define OBSTACLE_H
#include <iostream>
#include <vector>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <GLFW/glfw3.h>
using namespace std;
class Obstacle
{
public:
float posX, posY;
public:
Obstacle(float x, float y){
posX = x, posY = y;
}
void draw(){
glBegin(GL_QUADS);
glColor3f(1, 0, 0);
glVertex3f(posX + 10, posY + 10, 0);
glVertex3f(posX + 10, posY - 10, 0);
glVertex3f(posX - 10, posY - 10, 0);
glVertex3f(posX - 10, posY + 10, 0);
glEnd();
}
void add(){
draw();
}
};
#endif