summaryrefslogtreecommitdiff
path: root/src/Qualum.h
blob: 49a92b270c1a3acc8837a7b136a608eb845caae5 (plain)
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
#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 */