elements: starting the collision, finally work on it
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
#include "elements.hpp"
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
|
||||
void Point::assign() {
|
||||
std::srand(std::time(0));
|
||||
m_row = (rand() % (ROW));
|
||||
m_col = (rand() % (ROW));
|
||||
}
|
||||
|
||||
void Point::assign(int row, int col) {
|
||||
m_row = row;
|
||||
@@ -28,3 +36,16 @@ void PointCollection::move() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PointCollection::check_collision() {
|
||||
for(int i = m_point_list.size() - 1; i >= 0; i--) {
|
||||
if(m_point_list[i].m_direction == 'u') {
|
||||
}
|
||||
if(m_point_list[i].m_direction == 'd') {
|
||||
}
|
||||
if(m_point_list[i].m_direction == 'l') {
|
||||
}
|
||||
if(m_point_list[i].m_direction == 'r') {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user