#include <chrono>  
#include <windows.h>
#include<timeapi.h>
#include <iostream>
#pragma comment( lib,"winmm.lib" )
#include <sysinfoapi.h>
#include <math.h>
#include "Timer.h"
#include <cstdlib>


using namespace std;
using namespace chrono;
#define PI acos(-1);

/* Declare the Position by Structure*/
struct Position {
    float x;
    float y;
};
/*Define the velocity*/
struct Velocity
{
    float x;
    float y;
};
/*Define the color in RGB*/
struct Color {
    float R;
    float G;
    float B;
};

/*The Acceleration*/
struct Acceleration
{
    float x;
    float y;
};
const int SCREEN_WIDTH1 = 900;
const int SCREEN_HEIGHT1 = 600;
/*define class*/
class cParticle {
    /*Attributes*/
private:
    
    
    Acceleration acce;//Acceleration: define the path;
    int life;       //Life : seconds from activated to dead;


    unsigned int starttick;// windows ticks when activated;

    /* parameter needed to be saved in function update */
    unsigned int currenttick;//curent windows tick;

    unsigned int savedtick;// last save tickcount;
    int colornum = 0; //color change num

public:
    bool activate;  //a flag determine the activation;
    Velocity velo;  //velocity : in x and y direction;
    Position posi;  //Position :x and y;
    Color color;    // color :RGB color in float
    bool status = TRUE;
    unsigned int tickspent; //spent between 2 count;
    /* Constructor */
    cParticle();
    cParticle(int r);

    void setVelo(float vx, float vy);
    void ChangePosi(int x, int y);
    void ChangeColor();
    void Activate();
    ~cParticle();
    void update();
};

