Advertisement
TheMagnusRex

for game

Mar 12th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. void VREMYA(int t){
  2.     if(vremya>0){
  3.         glutTimerFunc(1000,VREMYA,vremya);
  4.         cout<<vremya<<endl;
  5.         vremya-=1;
  6.     }
  7.     else{
  8.         cout<<"gamnover"<<"your score"<<score<<endl;
  9.     }
  10. }
  11.  
  12. void clickplace(int butt, int state, int x, int y){
  13.     double tochx=double (x)/40.0-10.0;
  14.     double tochy=double(y)/-40.0 + 10.0;
  15.     double rx=tochx-xk;
  16.     double ry=tochy-yk;
  17.     double vekt=sqrt(rx*rx+ry*ry);
  18.     if(butt==0&&state==0&&vekt<=sk){
  19.         cout<<"popal"<<endl;
  20.         score+=1;
  21.         sk*=0.9;
  22.         xk=rand()%21-10+(rand()%11)/10;
  23.         yk=rand()%21-10+(rand()%11)/10;
  24.         draw();
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement