#include "GameObject.h" GameObject::GameObject( VariableTyp typ, int x, int y, int width, int height ) : Variable( typ ) { this->x = x; this->y = y; w = width; h = height; } void GameObject::setX( int x ) { this->x = x; } void GameObject::setY( int y ) { this->y = y; } void GameObject::setWidth( int width ) { w = width; } void GameObject::setHeight( int height ) { h = height; } bool GameObject::intersectsWith( GameObject *zObj ) { return x < zObj->x + zObj->w && x + w > zObj->x && y < zObj->y + zObj->h && y + h > zObj->y; } int GameObject::getX() const { return x; } int GameObject::getY() const { return y; } int GameObject::getWidth() const { return w; } int GameObject::getHeight() const { return h; }