summaryrefslogtreecommitdiff
path: root/src/Qualum.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <leonardomtenenbaum@gmail.com>2018-03-23 00:00:50 -0400
committerLeo Tenenbaum <leonardomtenenbaum@gmail.com>2018-03-23 00:00:50 -0400
commit5e54af301b2b99e8479da3195ef30d0f8ec19227 (patch)
tree0647a605126d94cc914345c587512cf7a9b59dc3 /src/Qualum.h
parentbedd7a371cc4649b95dc09bafa1c7ee23a4affb6 (diff)
Initial commit
Diffstat (limited to 'src/Qualum.h')
-rw-r--r--src/Qualum.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Qualum.h b/src/Qualum.h
new file mode 100644
index 0000000..49a92b2
--- /dev/null
+++ b/src/Qualum.h
@@ -0,0 +1,37 @@
+#ifndef QUALUM_H
+#define QUALUM_H
+
+#include <vector>
+#include <SDL.h>
+#include "Color.h"
+#include "Rendering.h"
+
+class Qualum {
+public:
+ Qualum(int x, int y, Color color, int sx, int sy);
+ ~Qualum();
+ static Qualum* create_qualum(int x, int y, Color color, int sx, int sy);
+ void render(SDL_Renderer* renderer);
+ void update();
+ static std::vector<Qualum*> qualums;
+ static void render_all(SDL_Renderer* renderer);
+ static void update_all(bool should_update);
+ static void initialize();
+ static int iterations;
+private:
+ static int locations[Rendering::GRID_HEIGHT][Rendering::GRID_WIDTH];
+ static void two_perpendiculars(int speedx, int speedy, int* speedx1, int* speedy1, int* speedx2, int* speedy2);
+ static void combine_speeds(int speedx1, int speedy1, int speedx2, int speedy2, int* speedx, int* speedy);
+ void collide_with(Qualum* q);
+ void debug();
+ void destroy();
+ int x, y, index;
+ int speedx, speedy;
+ int delayed;
+ bool can_collide;
+ Color color;
+
+};
+
+#endif /* QUALUM_H */
+