123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- //
- // checkedInVisitor.hpp
- // Projekt_FORUM
- //
- // Created by Sebastian Holzki on 19.06.19.
- //
-
- #pragma once
- #include "ofMain.h"
- #include <stdio.h>
-
-
-
-
-
- class CheckedInVisitor {
-
-
- public:
- CheckedInVisitor();
- ~CheckedInVisitor();
-
- void setup(int playerType, int checkedInStele, float sceneWidth, float sceneHeight);
- void update(float deltaT, float sceneWidth, float sceneHeight);
- void draw();
-
- void setupVelocity();
- void setupPosition(int x, int y, int checkedInStele);
- void setPosition(ofVec2f position);
- ofVec2f getPosition();
- ofVec2f getBottom();
-
- void fillAttractingPixelsVector(float sceneWidth, float sceneHeight);
- void pixelsWithValues(float sceneWidth, float sceneHeight, ofImage hexagon);
- void updateAttractingPixels();
-
-
- vector<ofVec2f>getPositionsOfAttractingPixels();
- void setupCornerPositions(float sceneWidth, float sceneHeight);
-
- void setStateOfSetup(bool setupFinished);
- bool getStateOfSetup();
-
- //Every CheckedInVisitor creates an Emitter for his starting Animation
- //Following methods will help to not get any bad access errors when emitting
- // from new attractors and not doing it from older ones
- bool getIfEmitterIsDeleted();
- void setIfEmitterIsDeleted(bool isDeleted);
-
- void setPlayerType();
- int getPlayerType();
-
- void startingAnimation(float startingSpeed, float sceneWidth, float sceneHeight);
- void move(float deltaT, float sceneWidth, float sceneHeight);
- void aging(float deltaT);
- float getAge();
-
-
-
- void clipToLastCheckedInVisitor(CheckedInVisitor visitor); //A particular "image" can clip its position, depending on the position of the last
-
-
- ofImage imageOfType;
- ofImage hexagon;
- vector<ofVec2f> attractingPixelsOfHexagon;
-
-
-
- private:
-
-
- int checkedInStele;
- int playerType;
- ofVec2f position;
- ofVec2f positionLastFrame;
-
-
-
- ofVec2f velocity;
- float xVelocityMax;
-
- bool started;
- bool startedMovingToTheRight;
- bool setupInOfAppIsFinished;
- bool startingAnimationIsFinished;
- bool emitterHasBeenDeleted;
-
-
- //Random values between 0.0 and 1.0
- float k1;
- float k2;
- float k3;
-
- float age;
-
-
-
-
-
-
- };
|