I am learning OOP using c++ on a MicroBit by developing this simple game

Dependencies:   microbit

gameEngine/source/game.cpp

Committer:
ahmeou
Date:
2020-07-09
Revision:
3:a21366e3261e
Parent:
1:25f13b341b11

File content as of revision 3:a21366e3261e:

#include "Sprite.h"

Sprite::Sprite(){
    m_x = 0;
    m_y = 0;
}

Sprite::Sprite(int x, int y){
    m_x = 0;
    m_y = 0;
}

void Sprite::setX(int x){
    m_x = x;
}

void Sprite::setY(int y){
    m_y = y;
}

int Sprite::getX(){
    return m_x;
}

int Sprite::getY(){
    return m_y;
}

bool Sprite::hitBy(Sprite another){
    return m_x == another.getX() && m_y == another.getY();
}