// // avatar.cpp // emptyExample // // Created by Sebastian Holzki on 17.04.19. // #include "avatar.hpp" Avatar::Avatar(int playerType){ setup(playerType); } // ----------------------------------------- Avatar::~Avatar(){ } // ----------------------------------------- void Avatar::setup(int playerType){ //Load the right icon from data in ofImage, by using the transmitted info about the playerType // --> icon = .... } // ----------------------------------------- void Avatar::update(){ } // ----------------------------------------- void Avatar::draw(){ icon.draw(position); } // ----------------------------------------- ofVec2f Avatar::getPosition(){ return position; } // ----------------------------------------- void Avatar::setPosition(int _x, int _y){ position.x = _x; position.y = _y; } void Avatar::setPosition(ofVec2f _position){ position = _position; } // ----------------------------------------- void Avatar::clipToAvatar(Avatar _avatar){ //Read coordinates to clip to: ofVec2f tempCoords = _avatar.getPosition(); if( tempCoords.y == 0 ){ position.x = tempCoords.x + 20 ; position.y = tempCoords.y + 20 ; }else{ position.x = tempCoords.x + 20 ; position.y = tempCoords.y - 20 ; } }