Quelcode des Partikelsystems Boden
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

checkedInVisitor.hpp 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // checkedInVisitor.hpp
  3. // Projekt_FORUM
  4. //
  5. // Created by Sebastian Holzki on 19.06.19.
  6. //
  7. #pragma once
  8. #include "ofMain.h"
  9. #include <stdio.h>
  10. class CheckedInVisitor {
  11. public:
  12. CheckedInVisitor();
  13. ~CheckedInVisitor();
  14. void setup(int playerType, int checkedInStele, float sceneWidth, float sceneHeight);
  15. void update(float deltaT, float sceneWidth, float sceneHeight);
  16. void draw();
  17. void setupVelocity();
  18. void setupPosition(int x, int y, int checkedInStele);
  19. void setPosition(ofVec2f position);
  20. ofVec2f getPosition();
  21. ofVec2f getBottom();
  22. void fillAttractingPixelsVector(float sceneWidth, float sceneHeight);
  23. void pixelsWithValues(float sceneWidth, float sceneHeight, ofImage hexagon);
  24. void updateAttractingPixels();
  25. vector<ofVec2f>getPositionsOfAttractingPixels();
  26. void setupCornerPositions(float sceneWidth, float sceneHeight);
  27. void setStateOfSetup(bool setupFinished);
  28. bool getStateOfSetup();
  29. //Every CheckedInVisitor creates an Emitter for his starting Animation
  30. //Following methods will help to not get any bad access errors when emitting
  31. // from new attractors and not doing it from older ones
  32. bool getIfEmitterIsDeleted();
  33. void setIfEmitterIsDeleted(bool isDeleted);
  34. void setPlayerType();
  35. int getPlayerType();
  36. void startingAnimation(float startingSpeed, float sceneWidth, float sceneHeight);
  37. void move(float deltaT, float sceneWidth, float sceneHeight);
  38. void aging(float deltaT);
  39. float getAge();
  40. void clipToLastCheckedInVisitor(CheckedInVisitor visitor); //A particular "image" can clip its position, depending on the position of the last
  41. ofImage imageOfType;
  42. ofImage hexagon;
  43. vector<ofVec2f> attractingPixelsOfHexagon;
  44. private:
  45. int checkedInStele;
  46. int playerType;
  47. ofVec2f position;
  48. ofVec2f positionLastFrame;
  49. ofVec2f velocity;
  50. float xVelocityMax;
  51. bool started;
  52. bool startedMovingToTheRight;
  53. bool setupInOfAppIsFinished;
  54. bool startingAnimationIsFinished;
  55. bool emitterHasBeenDeleted;
  56. //Random values between 0.0 and 1.0
  57. float k1;
  58. float k2;
  59. float k3;
  60. float age;
  61. };