aboutsummaryrefslogtreecommitdiffstats
path: root/src/gameplay.cpp
blob: 90b66034860ecb7bfb11f0af9e4d0b019a1ee76b (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
#include "gameplay.hpp"

#include <iostream>


Enemy::Enemy(void)
{
    posX = GetRandomValue(0, SCREENWIDTH);
    posY = GetRandomValue(0, SCREENHEIGHT);
    direction = (Vector2){posX, posY};
}

Enemy::~Enemy() {}
Game::~Game() {}

Game::Game(void)
{
    nEnemies = GetRandomValue(5, 15);

    enemies = new std::vector<Enemy>(nEnemies);
}

void Game::start() const
{
    std::cout << "----- Gameplay: Start -----" << std::endl;
    std::cout << "Gameplay: " << nEnemies << "enemies need to be spawned" << std::endl;

    for (auto & en : *enemies)
    {
        DrawCircleV(en.direction, 10, RED);
    }

}