ELEC2645 (2016/17) / Mbed 2 deprecated 2645_Project_el15as

Dependencies:   mbed

Revision:
12:0a5758356381
Parent:
4:1f7f32f3e017
--- a/GameObject/GameObject.cpp	Wed May 03 19:12:39 2017 +0000
+++ b/GameObject/GameObject.cpp	Wed May 03 19:57:08 2017 +0000
@@ -1,17 +1,21 @@
 #include "GameObject.h"
 
+// Constructor
 GameObject::GameObject()
 {
 
 }
 
+// Destructor
 GameObject::~GameObject()
 {
 
 }
 
+// Check whether the object contains the given point
 bool GameObject::containsPoint(int x, int y)
 {
+    // If it doesn't contain y - no point checking x
     if (containsY(y) == true) {
         if (containsX(x) == true) {
             return true;
@@ -20,6 +24,8 @@
     return false;
 }
 
+// Check whether the object contains the given x-coordinate
+// by comparing with every x-value the object occupies
 bool GameObject::containsX(int _x)
 {
     for (int i = 0; i < width; i++) {
@@ -30,6 +36,8 @@
     return false;
 }
 
+// Check whether the object contains the given y-coordinate
+// by comparing with every y-value the object occupies
 bool GameObject::containsY(int _y)
 {
     for (int i = 0; i < height; i++) {