-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshapeNode.cpp
More file actions
28 lines (26 loc) · 745 Bytes
/
shapeNode.cpp
File metadata and controls
28 lines (26 loc) · 745 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
#include "shapeNode.h"
using namespace std;
/*---------------------------------------------------
A square can check whether or not it is intersecting
with another square which is drawn on the screen
with this function
-------------------------------------------------*/
bool ShapeNode::isShapeNodeFound(int i_x ,int i_y)
{
int i; i = this->m_shape->get_x();
int x; x = this->m_shape->get_x();
int j; j = this->m_shape->get_y();
int y; y = this->m_shape->get_y();
int length = this->m_shape->get_length()-1;
for (i=x; i<x+length+1 ; i++)
{
for(j=y; j<y+length+1; j++)
{
if(i_x == i && i_y == j) //checks if pixels from one square are intersecting with another square
{
return TRUE;
}
}
}
return FALSE;
}