2019-07-02 01:17:44 -07:00
|
|
|
#pragma once
|
|
|
|
|
2019-07-02 22:32:50 -07:00
|
|
|
#define SPEED_REDUCE_PERCENTAGE 0.6
|
|
|
|
#define SPEED_REDUCE_LOCATION 0.5
|
|
|
|
#define MAX_SPEED_CHANGES 8
|
|
|
|
|
2019-07-02 01:17:44 -07:00
|
|
|
class Animation
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Animation();
|
|
|
|
~Animation();
|
|
|
|
|
2019-07-02 22:56:22 -07:00
|
|
|
void Animate(int animationOffset, int animationDistance, double pixelsPerSecond, bool allowDeceleration);
|
|
|
|
void CancelDeceleration();
|
2019-07-02 01:17:44 -07:00
|
|
|
bool IsAnimating();
|
|
|
|
void Tick();
|
|
|
|
int Position();
|
|
|
|
private:
|
|
|
|
LONG CurrentMilliseconds();
|
|
|
|
|
|
|
|
bool isAnimating;
|
|
|
|
int distance;
|
|
|
|
double location;
|
2019-07-02 22:32:50 -07:00
|
|
|
double speedChangeLocation;
|
|
|
|
int speedChanges;
|
2019-07-02 01:17:44 -07:00
|
|
|
int offset;
|
|
|
|
double speed;
|
2019-07-02 22:56:22 -07:00
|
|
|
double originalSpeed;
|
2019-07-02 01:17:44 -07:00
|
|
|
LONG lastMilliseconds;
|
|
|
|
};
|