123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- //
- // 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 ;
-
- }
-
- }
|