# Thread: Analog Clock

1. ## Analog Clock

Code:
```void Gadget::PaintClock(int x, int y)
{
struct tm * current_tm;
time_t current_time;

time (&current_time);
current_tm = localtime (&current_time);

//for(int r = 0; r < 50; r++)
//{
//	Surface->DrawColoredCircle(x,y,r,0,0,0,255);
//}

Surface->DrawColoredCircle(x,y,50,255,255,255,255);
Surface->DrawColoredCircle(x,y,49,255,255,255,255);

float alpha = 30*current_tm->tm_hour;
float beta = 6*current_tm->tm_min;
float phi = 6*current_tm->tm_sec;

int nx = x+35*sin(ToRadia(alpha));
int ny = y-35*cos(ToRadia(alpha));

int nx2 = x+45*sin(ToRadia(beta));
int ny2 = y-45*cos(ToRadia(beta));

int nx3 = x+40*sin(ToRadia(phi));
int ny3 = y-40*cos(ToRadia(phi));

DrawLine(x,y,nx,ny);
DrawLine(x+1,y+1,nx,ny);
DrawLine(x,y,nx2,ny2);
DrawLine(x+1,y+1,nx2,ny2);
DrawLine(x,y,nx3,ny3);

}```
CREDITS TO WHOEVER MADE THIS!!

2. ## The Following User Says Thank You to GameTrainerMaker For This Useful Post:

hgmf8124 (08-22-2010)

3. great job gtm!

4. sounds sexy.. do u have a screenshot?

5. no Sorry!! i formatted and dont have any games,programs etc

6. hi hows it going?

7. You're missing a bunch of things in this...

8. i no. if the leechers are good C++ers then they will no how to fix it!

9. Angle to radian function, Surface, and the DrawLine function.

Those aren't hard though.

10. Nothing Google cant fix..