-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmover.h
More file actions
43 lines (37 loc) · 921 Bytes
/
mover.h
File metadata and controls
43 lines (37 loc) · 921 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
39
40
41
42
43
#ifndef MOVER_H
#define MOVER_H
#include "vec2.h"
#include "sdl_helpers.h"
#include "globals.h"
#include <SDL2/SDL.h>
#include <string>
#include <vector>
class mover
{
public:
static std::vector<mover*> moverList;
int id;
vec2 position;
vec2 velocity;
vec2 acceleration;
float maxSpeed;
float mass;
int width;
int height;
private:
SDL_Texture* image;
public:
mover(float posX=1, float posY=1, float velX=0, float velY=0, float AccX=0, float AccY=0, float maxS=10, float _mass=1);
~mover();
int getWidth(){return width;};
int getHeight(){return height;};
int setWidth(int w){width=w;};
int setHeight(int h){height=h;};
void edgeCollision();
void objectCollision(mover*);
void display(SDL_Renderer* ren);
void loadImage(std::string imagePath, SDL_Renderer*& ren);
void update();
void applyForce(vec2 force);
};
#endif // MOVER_H