test
This commit is contained in:
parent
37776af5db
commit
ab03d5f10c
4045 changed files with 286212 additions and 3 deletions
17
.config/Code/User/History/eedc553/1ley.h
Normal file
17
.config/Code/User/History/eedc553/1ley.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x) : height(25), y(10), width(width), x(x){
|
||||
DrawRectangle(x, y, width, height, colors[GRAY]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
30
.config/Code/User/History/eedc553/3kIi.h
Normal file
30
.config/Code/User/History/eedc553/3kIi.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
int y;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, int y, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
int getX();
|
||||
int getY();
|
||||
int getWidth();
|
||||
int getHeight();
|
||||
Paddle& setWidth(int width);
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
#endif
|
7
.config/Code/User/History/eedc553/4KNP.h
Normal file
7
.config/Code/User/History/eedc553/4KNP.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
class Paddle{
|
||||
const int height;
|
||||
int width;
|
||||
|
||||
|
||||
|
||||
};
|
32
.config/Code/User/History/eedc553/4vkl.h
Normal file
32
.config/Code/User/History/eedc553/4vkl.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include "util.h"
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball& ball){
|
||||
if(ball.getY() - ball.getRadius() < y+height && ball.getX()+ball.getRadius() > x && ball.getX()-ball.getRadius() < x+width){
|
||||
ball.setVY(ball.getVY()*-1);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
23
.config/Code/User/History/eedc553/9WNn.h
Normal file
23
.config/Code/User/History/eedc553/9WNn.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
Paddle& setX(int x);
|
||||
};
|
||||
|
||||
#endif
|
18
.config/Code/User/History/eedc553/BPcE.h
Normal file
18
.config/Code/User/History/eedc553/BPcE.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x) : height(25), y(10), width(width), x(x){
|
||||
DrawRectangle(x, y, width, height, colors[GRAY]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
21
.config/Code/User/History/eedc553/C7ri.h
Normal file
21
.config/Code/User/History/eedc553/C7ri.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x) : x(x){
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
3
.config/Code/User/History/eedc553/Dt2C.h
Normal file
3
.config/Code/User/History/eedc553/Dt2C.h
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Paddle{
|
||||
|
||||
};
|
13
.config/Code/User/History/eedc553/Ew26.h
Normal file
13
.config/Code/User/History/eedc553/Ew26.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x) : height(25), y(10), width(width), x(x){}
|
||||
|
||||
|
||||
};
|
30
.config/Code/User/History/eedc553/FDHa.h
Normal file
30
.config/Code/User/History/eedc553/FDHa.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
// #ifndef PADDLE_H
|
||||
// #define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
int getX();
|
||||
int getY();
|
||||
int getWidth();
|
||||
int getHeight();
|
||||
Paddle& setWidth(int width);
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
// #endif
|
36
.config/Code/User/History/eedc553/G86Y.h
Normal file
36
.config/Code/User/History/eedc553/G86Y.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball& ball){
|
||||
if(ball.getY() - ball.getRadius() < y+height && ball.getX()+ball.getRadius() > x && ball.getX()-ball.getRadius() < x+width){
|
||||
ball.setVY(ball.getVY()*-1);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
26
.config/Code/User/History/eedc553/JEJu.h
Normal file
26
.config/Code/User/History/eedc553/JEJu.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10) this->x = 10;
|
||||
else if(x > 1010) this->x = 1010;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
37
.config/Code/User/History/eedc553/JjpJ.h
Normal file
37
.config/Code/User/History/eedc553/JjpJ.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "util.h"
|
||||
#include "Paddle.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball& ball){
|
||||
if(ball.getY() - ball.getRadius() < y+height && ball.getX()+ball.getRadius() > x && ball.getX()-ball.getRadius() < x+width){
|
||||
ball.setVY(ball.getVY()*-1);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
29
.config/Code/User/History/eedc553/MItV.h
Normal file
29
.config/Code/User/History/eedc553/MItV.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball ball){
|
||||
|
||||
}
|
||||
|
||||
};
|
17
.config/Code/User/History/eedc553/NCjl.h
Normal file
17
.config/Code/User/History/eedc553/NCjl.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
|
||||
};
|
26
.config/Code/User/History/eedc553/Nw8Q.h
Normal file
26
.config/Code/User/History/eedc553/Nw8Q.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width/2;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
17
.config/Code/User/History/eedc553/O7K2.h
Normal file
17
.config/Code/User/History/eedc553/O7K2.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x) : height(25), y(10), width(width), x(x){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
30
.config/Code/User/History/eedc553/P8Gi.h
Normal file
30
.config/Code/User/History/eedc553/P8Gi.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
int y;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, int y, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
int getX();
|
||||
int getY();
|
||||
int getWidth();
|
||||
int getHeight();
|
||||
Paddle& setWidth(int width);
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
#endif
|
25
.config/Code/User/History/eedc553/Qi0D.h
Normal file
25
.config/Code/User/History/eedc553/Qi0D.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
// #ifndef PADDLE_H
|
||||
// #define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
// #endif
|
11
.config/Code/User/History/eedc553/RvBk.h
Normal file
11
.config/Code/User/History/eedc553/RvBk.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
|
||||
Paddle(int width, int x) : height(25), y(10), width(width), x(x){}
|
||||
|
||||
|
||||
};
|
25
.config/Code/User/History/eedc553/VZhV.h
Normal file
25
.config/Code/User/History/eedc553/VZhV.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
};
|
31
.config/Code/User/History/eedc553/Vdky.h
Normal file
31
.config/Code/User/History/eedc553/Vdky.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball& ball){
|
||||
if(ball.getY() - ball.getRadius() < y+height && ball.getX()+ball.getRadius() > x && ball.getX()-ball.getRadius() < x+width){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
};
|
25
.config/Code/User/History/eedc553/WzLI.h
Normal file
25
.config/Code/User/History/eedc553/WzLI.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
#endif
|
31
.config/Code/User/History/eedc553/XBS6.h
Normal file
31
.config/Code/User/History/eedc553/XBS6.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball& ball){
|
||||
if(ball.getY() - ball.getRadius() < y+height && ball.getX()+ball.getRadius() > x && ball.getX()-ball.getRadius() < x+width){
|
||||
ball.setVY(ball.getVY()*-1);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
29
.config/Code/User/History/eedc553/YDp5.h
Normal file
29
.config/Code/User/History/eedc553/YDp5.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball& ball){
|
||||
if(ball.getY() - ball.getRadius() < y+height)
|
||||
}
|
||||
|
||||
};
|
24
.config/Code/User/History/eedc553/YQvB.h
Normal file
24
.config/Code/User/History/eedc553/YQvB.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10) this->x = 10;
|
||||
else if(x > 1010) this->x = 1010;
|
||||
else this->x = x;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
26
.config/Code/User/History/eedc553/Yvrc.h
Normal file
26
.config/Code/User/History/eedc553/Yvrc.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
8
.config/Code/User/History/eedc553/byMj.h
Normal file
8
.config/Code/User/History/eedc553/byMj.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
class Paddle{
|
||||
const int height;
|
||||
int width;
|
||||
int x;
|
||||
|
||||
|
||||
|
||||
};
|
25
.config/Code/User/History/eedc553/c0HE.h
Normal file
25
.config/Code/User/History/eedc553/c0HE.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
// #ifndef PADDLE_H
|
||||
// #define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
// #endif
|
26
.config/Code/User/History/eedc553/e8vk.h
Normal file
26
.config/Code/User/History/eedc553/e8vk.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010) this->x = 1010;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
1
.config/Code/User/History/eedc553/entries.json
Normal file
1
.config/Code/User/History/eedc553/entries.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/OOP/Project/Paddle.h","entries":[{"id":"Dt2C.h","timestamp":1714200679116},{"id":"4KNP.h","timestamp":1714200711026},{"id":"byMj.h","timestamp":1714200727315},{"id":"hxhi.h","timestamp":1714200783746},{"id":"RvBk.h","timestamp":1714200841565},{"id":"Ew26.h","timestamp":1714200888536},{"id":"iV7D.h","timestamp":1714200909619},{"id":"O7K2.h","timestamp":1714200921529},{"id":"1ley.h","timestamp":1714200956598},{"id":"BPcE.h","timestamp":1714200992267},{"id":"feI3.h","timestamp":1714201027859},{"id":"NCjl.h","timestamp":1714201052246},{"id":"C7ri.h","timestamp":1714201175956},{"id":"zbsV.h","timestamp":1714201195839},{"id":"YQvB.h","timestamp":1714201397756},{"id":"jp4I.h","timestamp":1714201497858},{"id":"vRgW.h","timestamp":1714201620190},{"id":"JEJu.h","timestamp":1714201649363},{"id":"e8vk.h","timestamp":1714201687442},{"id":"Nw8Q.h","timestamp":1714201785494},{"id":"Yvrc.h","timestamp":1714201867484},{"id":"VZhV.h","timestamp":1714201926613},{"id":"MItV.h","timestamp":1714272245240},{"id":"kiFm.h","timestamp":1714272268258},{"id":"YDp5.h","timestamp":1714272477576},{"id":"Vdky.h","timestamp":1714272622464},{"id":"XBS6.h","timestamp":1714272681632},{"id":"4vkl.h","timestamp":1714272761248},{"id":"l6Ih.h","timestamp":1714272966483},{"id":"gWeL.h","timestamp":1714272996828},{"id":"JjpJ.h","timestamp":1714273832560},{"id":"G86Y.h","timestamp":1714273846260},{"id":"my86.h","timestamp":1714273978593},{"id":"mPMf.h","timestamp":1714273997766},{"id":"9WNn.h","timestamp":1714274337833},{"id":"gPwQ.h","timestamp":1714294440659},{"id":"WzLI.h","timestamp":1714700105840},{"id":"idN5.h","timestamp":1714700308271},{"id":"hmex.h","timestamp":1714700558138},{"id":"Qi0D.h","timestamp":1714733697738},{"id":"c0HE.h","timestamp":1714734073958},{"id":"nf01.h","timestamp":1714822743409},{"id":"rwFs.h","timestamp":1714822779869},{"id":"yt8Q.h","timestamp":1714822826452},{"id":"FDHa.h","timestamp":1714888981463},{"id":"t8bD.h","timestamp":1714890061176},{"id":"g1sy.h","timestamp":1715160321925},{"id":"3kIi.h","timestamp":1715160332091},{"id":"P8Gi.h","timestamp":1715160406180}]}
|
18
.config/Code/User/History/eedc553/feI3.h
Normal file
18
.config/Code/User/History/eedc553/feI3.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x){
|
||||
DrawRectangle(x, y, width, height, colors[GRAY]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
30
.config/Code/User/History/eedc553/g1sy.h
Normal file
30
.config/Code/User/History/eedc553/g1sy.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
int y;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
int getX();
|
||||
int getY();
|
||||
int getWidth();
|
||||
int getHeight();
|
||||
Paddle& setWidth(int width);
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
#endif
|
24
.config/Code/User/History/eedc553/gPwQ.h
Normal file
24
.config/Code/User/History/eedc553/gPwQ.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
Paddle& setX(int x);
|
||||
};
|
||||
|
||||
#endif
|
36
.config/Code/User/History/eedc553/gWeL.h
Normal file
36
.config/Code/User/History/eedc553/gWeL.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball& ball){
|
||||
if(ball.getY() - ball.getRadius() < y+height && ball.getX()+ball.getRadius() > x && ball.getX()-ball.getRadius() < x+width){
|
||||
ball.setVY(ball.getVY()*-1);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
25
.config/Code/User/History/eedc553/hmex.h
Normal file
25
.config/Code/User/History/eedc553/hmex.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
#endif
|
11
.config/Code/User/History/eedc553/hxhi.h
Normal file
11
.config/Code/User/History/eedc553/hxhi.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
16
.config/Code/User/History/eedc553/iV7D.h
Normal file
16
.config/Code/User/History/eedc553/iV7D.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x) : height(25), y(10), width(width), x(x){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
25
.config/Code/User/History/eedc553/idN5.h
Normal file
25
.config/Code/User/History/eedc553/idN5.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
Paddle& setX(int x);
|
||||
// ~Paddle();
|
||||
};
|
||||
|
||||
#endif
|
26
.config/Code/User/History/eedc553/jp4I.h
Normal file
26
.config/Code/User/History/eedc553/jp4I.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10) this->x = 10;
|
||||
else if(x > 1010) this->x = 1010;
|
||||
else this->x = x;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
28
.config/Code/User/History/eedc553/kiFm.h
Normal file
28
.config/Code/User/History/eedc553/kiFm.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball& ball){
|
||||
}
|
||||
|
||||
};
|
31
.config/Code/User/History/eedc553/l6Ih.h
Normal file
31
.config/Code/User/History/eedc553/l6Ih.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball& ball){
|
||||
if(ball.getY() - ball.getRadius() < y+height && ball.getX()+ball.getRadius() > x && ball.getX()-ball.getRadius() < x+width){
|
||||
ball.setVY(ball.getVY()*-1);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
22
.config/Code/User/History/eedc553/mPMf.h
Normal file
22
.config/Code/User/History/eedc553/mPMf.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
Paddle& setX(int x);
|
||||
};
|
||||
|
||||
#endif
|
35
.config/Code/User/History/eedc553/my86.h
Normal file
35
.config/Code/User/History/eedc553/my86.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10 + width/2) this->x = 10;
|
||||
else if(x > 1010 - width/2) this->x = 1010 - width;
|
||||
else this->x = x - width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void checkCollision(Ball& ball){
|
||||
if(ball.getY() - ball.getRadius() < y+height && ball.getX()+ball.getRadius() > x && ball.getX()-ball.getRadius() < x+width){
|
||||
ball.setVY(ball.getVY()*-1);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
27
.config/Code/User/History/eedc553/nf01.h
Normal file
27
.config/Code/User/History/eedc553/nf01.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
// #ifndef PADDLE_H
|
||||
// #define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
void getX();
|
||||
void getY();
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
// #endif
|
27
.config/Code/User/History/eedc553/rwFs.h
Normal file
27
.config/Code/User/History/eedc553/rwFs.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
// #ifndef PADDLE_H
|
||||
// #define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
int getX();
|
||||
int getY();
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
// #endif
|
30
.config/Code/User/History/eedc553/t8bD.h
Normal file
30
.config/Code/User/History/eedc553/t8bD.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef PADDLE_H
|
||||
#define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
int getX();
|
||||
int getY();
|
||||
int getWidth();
|
||||
int getHeight();
|
||||
Paddle& setWidth(int width);
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
#endif
|
26
.config/Code/User/History/eedc553/vRgW.h
Normal file
26
.config/Code/User/History/eedc553/vRgW.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){}
|
||||
|
||||
void draw(){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
if(x < 10) this->x = 10;
|
||||
else if(x > 1010) this->x = 1010;
|
||||
else this->x = x + width/2;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
29
.config/Code/User/History/eedc553/yt8Q.h
Normal file
29
.config/Code/User/History/eedc553/yt8Q.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
// #ifndef PADDLE_H
|
||||
// #define PADDLE_H
|
||||
|
||||
#include "Ball.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color);
|
||||
Paddle(const Paddle& other);
|
||||
|
||||
void draw();
|
||||
void checkCollision(Ball& ball);
|
||||
|
||||
int getX();
|
||||
int getY();
|
||||
int getWidth();
|
||||
int getHeight();
|
||||
Paddle& setX(int x);
|
||||
~Paddle();
|
||||
};
|
||||
|
||||
// #endif
|
22
.config/Code/User/History/eedc553/zbsV.h
Normal file
22
.config/Code/User/History/eedc553/zbsV.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include "util.h"
|
||||
class Paddle{
|
||||
const int height;
|
||||
const int y;
|
||||
|
||||
int width;
|
||||
int x;
|
||||
float *color;
|
||||
|
||||
public:
|
||||
|
||||
Paddle(int width, int x, float *color) : height(25), y(10), width(width), x(x), color(color){
|
||||
DrawRectangle(x, y, width, height, color);
|
||||
}
|
||||
|
||||
Paddle& setX(int x){
|
||||
this->x = x;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue