This commit is contained in:
RafayAhmad7548 2024-06-16 18:53:25 +05:00
parent 37776af5db
commit ab03d5f10c
4045 changed files with 286212 additions and 3 deletions

View file

@ -0,0 +1,23 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball& ball) override{
}
~GreenFood(){}
};

View file

@ -0,0 +1,22 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
int height;
int width;
public:
GreenFood(int x, int y, int width, int height, float *color) : width(width), height(height), Food(x, y, color){}
void draw(){
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void fall(){
y -= 5;
}
~GreenFood(){}
};

View file

@ -0,0 +1,23 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball& ball) override{
paddle.setWidth(paddle.getWidth()*2);
}
~GreenFood(){}
};

View file

@ -0,0 +1,22 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y, float *color) : Food(x, y, color){}
void draw(){
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void fall(){
y -= 5;
}
~GreenFood(){}
};

View file

@ -0,0 +1,19 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
~GreenFood(){}
};

View file

@ -0,0 +1,22 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 10;
const int width = 5;
public:
GreenFood(int x, int y, float *color) : Food(x, y, color){}
void draw(){
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void fall(){
y -= 5;
}
~GreenFood(){}
};

View file

@ -0,0 +1,26 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball& ball) override{
if(Food::counter == 0){
paddle.setWidth(paddle.getWidth()*2);
powerActive = true;
}
}
~GreenFood(){}
};

View file

@ -0,0 +1,26 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball& ball) override{
// if(Food::counter == 0){
// paddle.setWidth(paddle.getWidth()*2);
// powerActive = true;
// }
}
~GreenFood(){}
};

View file

@ -0,0 +1,25 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball**& balls) override{
if(Food::counter == 0){
if(paddle.getWidth() < 250) paddle.setWidth(paddle.getWidth()*2);
}
}
~GreenFood(){}
};

View file

@ -0,0 +1,16 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
int height;
public:
GreenFood(int x, int y, int height, float *color) : height(height), Food(x, y, color){}
void draw(){
}
};

View file

@ -0,0 +1,22 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw(){
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void fall(){
y -= 5;
}
~GreenFood(){}
};

View file

@ -0,0 +1,26 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball**& balls) override{
if(Food::counter == 0){
paddle.setWidth(250);
powerActive = true;
}
}
~GreenFood(){}
};

View file

@ -0,0 +1,26 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball**& balls) override{
if(Food::counter == 0){
paddle.setWidth(paddle.getWidth()*2);
// powerActive = true;
}
}
~GreenFood(){}
};

View file

@ -0,0 +1,20 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
int height;
int width;
public:
GreenFood(int x, int y, int width, int height, float *color) : width(width), height(height), Food(x, y, color){}
void draw(){
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void fall(){
y -= 5;
}
};

View file

@ -0,0 +1,23 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball& ball) override{
if(Food::counter == 0) paddle.setWidth(paddle.getWidth()*2);
}
~GreenFood(){}
};

View file

@ -0,0 +1,17 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
int height;
int width;
public:
GreenFood(int x, int y, int width, int height, float *color) : width(width), height(height), Food(x, y, color){}
void draw(){
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
};

View file

@ -0,0 +1,9 @@
#include "Food.h"
class GreenFood : public Food{
};

View file

@ -0,0 +1,19 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw(){
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
~GreenFood(){}
};

View file

@ -0,0 +1,23 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball& ball) override{
}
~GreenFood(){}
};

View file

@ -0,0 +1 @@
{"version":1,"resource":"file:///home/rafayahmad/Stuff/OOP/Project/GreenFood.cpp","entries":[{"id":"vlrn.cpp","timestamp":1714700960002},{"id":"SNN3.cpp","timestamp":1714700987840},{"id":"j9T8.cpp","timestamp":1714701019626},{"id":"p5fd.cpp","timestamp":1714701069105},{"id":"oScw.cpp","timestamp":1714701083390},{"id":"N4YD.cpp","timestamp":1714701111128},{"id":"fIRJ.cpp","timestamp":1714701145343},{"id":"r4gr.cpp","timestamp":1714701169057},{"id":"SKaa.cpp","timestamp":1714701225956},{"id":"RgxD.cpp","timestamp":1714701285292},{"id":"7Bdr.cpp","timestamp":1714701318723},{"id":"mwt9.cpp","timestamp":1714701435755},{"id":"EUjz.cpp","timestamp":1714701465429},{"id":"9TsP.cpp","timestamp":1714702236685},{"id":"ND8s.cpp","timestamp":1714702473258},{"id":"a3ri.cpp","timestamp":1714702525274},{"id":"Cx7L.cpp","timestamp":1714702743227},{"id":"5Qnl.cpp","timestamp":1714888721264},{"id":"aguY.cpp","timestamp":1714888959253},{"id":"8Qid.cpp","timestamp":1714889024466},{"id":"hg84.cpp","timestamp":1714889045133},{"id":"ewGJ.cpp","timestamp":1714889057666},{"id":"SFSe.cpp","timestamp":1714889095623},{"id":"za5K.cpp","timestamp":1714889620175},{"id":"JxWo.cpp","timestamp":1714896504457},{"id":"HcSX.cpp","timestamp":1714896704795},{"id":"iodW.cpp","timestamp":1714974830972},{"id":"xsOa.cpp","timestamp":1715074668513},{"id":"PkdU.cpp","timestamp":1715138510931},{"id":"sCBe.cpp","timestamp":1715146180209},{"id":"QcUG.cpp","timestamp":1715146363531},{"id":"wXyc.cpp","timestamp":1715146389062},{"id":"vJkI.cpp","timestamp":1715146537761},{"id":"Lce1.cpp","timestamp":1715147322024},{"id":"vg9f.cpp","timestamp":1715182392624}]}

View file

@ -0,0 +1,23 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball& ball) override{
paddle.setWidth(paddle.getWidth()*2);
}
~GreenFood(){}
};

View file

@ -0,0 +1,17 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
int height;
int width;
public:
GreenFood(int x, int y, int height, int width, float *color) : height(height), Food(x, y, color){}
void draw(){
DrawTriangle(x, y, )
}
};

View file

@ -0,0 +1,23 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball& ball) override{
if(Food::counter == 0) paddle.setWidth(paddle.getWidth()*2);
}
~GreenFood(){}
};

View file

@ -0,0 +1,26 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball& ball, Ball*& ball1, Ball*& ball2) override{
if(Food::counter == 0){
paddle.setWidth(paddle.getWidth()*2);
powerActive = true;
}
}
~GreenFood(){}
};

View file

@ -0,0 +1,9 @@
#include "Food.h"
class GreenFood : public Food{
int height;
};

View file

@ -0,0 +1,22 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
int height;
int width;
public:
GreenFood(int x, int y, float *color) : width(width), height(height), Food(x, y, color){}
void draw(){
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void fall(){
y -= 5;
}
~GreenFood(){}
};

View file

@ -0,0 +1,13 @@
#include "Food.h"
class GreenFood : public Food{
int height;
public:
GreenFood(int x, int y, int height, float *color) : height(height), Food(x, y, color){}
};

View file

@ -0,0 +1,13 @@
#include "Food.h"
class GreenFood : public Food{
int height;
public:
GreenFood(int x, int y, int height) : height(height), Food(){}
};

View file

@ -0,0 +1,17 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
int height;
int width;
public:
GreenFood(int x, int y, int width, int height, float *color) : width(width), height(height), Food(x, y, color){}
void draw(){
DrawTriangle(x, y, )
}
};

View file

@ -0,0 +1,26 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball**& balls) override{
if(Food::counter == 0){
paddle.setWidth(250);
// powerActive = true;
}
}
~GreenFood(){}
};

View file

@ -0,0 +1,26 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball**& balls) override{
if(Food::counter == 0){
if(paddle.getWidth() < 250) paddle.setWidth(paddle.getWidth()*2);
powerActive = true;
}
}
~GreenFood(){}
};

View file

@ -0,0 +1,25 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball**& balls) override{
if(Food::counter == 0){
if(paddle.getWidth() < 240) paddle.setWidth(paddle.getWidth()*2);
}
}
~GreenFood(){}
};

View file

@ -0,0 +1,9 @@
#include "Food.h"
class GreenFood : public Food{
};

View file

@ -0,0 +1,25 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball**& balls) override{
if(Food::counter == 0){
if(paddle.getWidth() < 250) paddle.setWidth(paddle.getWidth()*2);
}
}
~GreenFood(){}
};

View file

@ -0,0 +1,26 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball**& balls) override{
if(Food::counter == 0){
paddle.setWidth(paddle.getWidth()*2);
powerActive = true;
}
}
~GreenFood(){}
};

View file

@ -0,0 +1,26 @@
#include "Food.h"
#include "util.h"
class GreenFood : public Food{
const int height = 20;
const int width = 10;
public:
GreenFood(int x, int y) : Food(x, y, colors[GREEN]){}
void draw() override{
DrawTriangle(x, y, x-width, y+height, x+width, y+height, color);
}
void activatePowerup(Paddle& paddle, Ball& ball) override{
if(Food::counter == 0){
paddle.setWidth(paddle.getWidth()*2);
powerActive = true;
}
}
~GreenFood(){}
};