SHARE
TWEET

Untitled

a guest Oct 14th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef BASESPRITECLASS_H
  2. #define BASESPRITECLASS_H
  3.  
  4. struct baseSpriteClass
  5. {
  6.     int mPosX;
  7.     int mPosY;
  8.     int mWidth;
  9.     int mHeight;
  10.  
  11.     int velX;
  12.     int velY;
  13.     int originalX;
  14.     int originalY;
  15.  
  16.     int originalVelX;
  17.     sf::Texture texture;
  18.     sf::Sprite mRect;
  19.  
  20.     int left;
  21.     int right;
  22.     int top;
  23.     int bottom;
  24.  
  25.     int getWidth() { return mWidth; }
  26.     int getHeight() { return mHeight; }
  27.     int& getPosX() { return mPosX; }
  28.     int& getPosY() { return mPosY; }
  29.  
  30.     void setPosX(int x) { mPosX = x; }
  31.     void setPosY(int y) { mPosY = y; }
  32.  
  33.     virtual void move()
  34.     {
  35.         mPosX += velX;
  36.         mPosY += velY;
  37.  
  38.         mRect.setPosition(sf::Vector2f(mPosX, mPosY));
  39.     }
  40.     virtual sf::Sprite& getRect() { return mRect; }
  41.     // rename this later wtf
  42.     virtual bool update() { return false; }
  43. };
  44.  
  45. #endif // BASESPRITECLASS_H
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top