This commit is contained in:
Solomon W. 2020-06-04 23:13:09 -04:00
parent 356f646f95
commit de95a6317e
8 changed files with 25 additions and 11 deletions

View File

@ -1,5 +1,5 @@
CC = clang
LINK = -lstdc++ -lSDL2 -lm -ldl -lSDL_gfx
LINK = -lstdc++ -lSDL2 -lm -ldl #-lSDL_gfx
DBG = -Wall -g -gmodules -O0
CC += $(DBG)

View File

@ -1,6 +1,8 @@
#ifndef BOUND
#define BOUND
#include <cstddef>
#include "Quad.h"
class BoundingBox {
private:
size_t parent;
@ -41,4 +43,5 @@ class BoundingBox {
BoundingBox();
void update();
void render(SDL_Renderer *rend);
};
};
#endif

View File

@ -1,10 +1,11 @@
#ifndef CIRCLE
#define CIRCLE
#include <SDL2/SDL.h>
#include <cmath>
#include "Vector.h"
#include "Color.h"
#ifndef CIRCLE
#define CIRCLE
class Circle {
private:
int testpoint(int x,int y) {

View File

@ -1,7 +1,6 @@
#include <stdint.h>
#ifndef COLOR
#define COLOR
#include <stdint.h>
#ifndef RED
#define RED 255,0,0,255

View File

@ -96,4 +96,4 @@ bool Quad::isInitialized() {
} else {
return false;
}
}*/
}*/

View File

@ -1,3 +1,5 @@
#ifndef QUAD
#define QUAD
#include <vector>
#include "SDL2/SDL.h"
#include "Vector.h"
@ -17,4 +19,5 @@ class Quad {
void render(SDL_Renderer *renderer);
void translate(Vector vec);
//bool isInitialized();
};
};
#endif

View File

@ -1,3 +1,6 @@
#ifndef WINDOW
#define WINDOW
#include <SDL2/SDL.h>
#include <SDL2/SDL_timer.h>
#include "Color.h"
@ -12,3 +15,4 @@ class Window {
void setClearColor(Color c);
void setClearColor(Uint8 r,Uint8 g,Uint8 b,Uint8 a);
};
#endif

View File

@ -1,3 +1,6 @@
#ifndef PHYS
#define PHYS
#include "BoundingBox.h"
#include "Circle.h"
#include <vector>
@ -7,7 +10,7 @@ class phys_obj {
Vector velocity;
Circle obj;
BoundingBox bounds;
bool contact_floor;
bool contact_floor;
phys_obj();
phys_obj(Circle c);
phys_obj(Circle c, Vector init_vel);
@ -16,7 +19,8 @@ class phys_obj {
static void calculate_vectors(std::vector<phys_obj> *objects, Vector win_dim);
void translate(Vector vec);
bool checkCollision(phys_obj o);
float angleTo(phys_obj o);
float angleTo(phys_obj o);
int distanceTo(Circle c);
void setPosition(Vector vec);
};
#endif