SDLPP: add constant rotation

This commit is contained in:
2023-04-08 20:19:22 +02:00
parent 5a0cb397b1
commit 9617499ab8
6 changed files with 35 additions and 4 deletions
+8
View File
@@ -131,10 +131,16 @@ public:
void setRotationCenter( const Vec2D< double > &center );
void rotateClockwise( int angle );
void rotateCounterClockwise( int angle );
void setRotationSpeed(int speed);
void startRotation();
void stopRotation();
protected:
virtual void copyTo( std::shared_ptr< RenderObject > other );
bool entireTexture();
bool isRotating() {
return rotating;
}
std::vector< std::shared_ptr< CollisionPolygon > > collisions;
std::shared_ptr< Texture > texture;
std::shared_ptr< Texture > cur_texture;
@@ -164,6 +170,8 @@ protected:
Vec2D< double > rotation_center = { -1, -1 };
SDL_Point rotation_center_point;
int rotation_angle = 0;
int rotation_speed = 720;
bool rotating = false;
private:
friend Scene;