Advertisement
apl-mhd

game loading

Dec 23rd, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.52 KB | None | 0 0
  1. # include "iGraphics.h"
  2.  
  3. int width = 0;
  4.  
  5. void incrementY(){
  6.  
  7.     if(width<200){
  8.     width +=2;
  9.    
  10.     }
  11.    
  12. }
  13.  
  14. //leftX.xyAxis[1] = 100;
  15.  
  16. void iDraw()
  17. {
  18.  
  19.     iClear();
  20.    
  21.     iSetColor(2505,0,0);
  22.    iRectangle(100, 285, 200, 30); //first left block
  23.     iSetColor(255,12,13);
  24.     iFilledRectangle(100,286,width,29);
  25.  
  26. }
  27.  
  28. void iMouseMove(int mx, int my)
  29. {
  30.  
  31.  
  32.     printf(" %d %d\n", mx, my);
  33. }
  34.     void iText(GLdouble x, GLdouble y, char *str, void* font=GLUT_BITMAP_8_BY_13){
  35.    
  36.    
  37.     }
  38. void iMouse(int button, int state, int mx, int my)
  39. {
  40.     if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN)
  41.     {
  42.  
  43.     }
  44.     if (button == GLUT_RIGHT_BUTTON && state == GLUT_DOWN)
  45.     {
  46.  
  47.     }
  48. }
  49.  
  50. void iKeyboard(unsigned char key)
  51. {
  52.     if (key == 'q')
  53.     {
  54.  
  55.     }
  56.  
  57. }
  58.  
  59.  
  60. void iSpecialKeyboard(unsigned char key)
  61. {
  62.     if (key == GLUT_KEY_UP)
  63.     {
  64.        
  65.         //exit(0);
  66.     }
  67.  
  68.     if (key == GLUT_KEY_DOWN)
  69.     {
  70.  
  71.        
  72.         /*
  73.         if ((circleY - firstMidY) <= 25 && circleX <250 && circleX>150){
  74.             circleY = 590;
  75.  
  76.         }
  77.         else
  78.             circleY -= 4;
  79.         printf("%d\n", circleX);
  80.         //exit(0);
  81.         */
  82.     }
  83.  
  84.  
  85.     if (key == GLUT_KEY_LEFT)
  86.     {
  87.  
  88.        
  89.  
  90.         //exit(0);
  91.     }
  92.  
  93.     if (key == GLUT_KEY_RIGHT)
  94.     {
  95.        
  96.  
  97.         //exit(0);
  98.     }
  99.  
  100. }
  101. int main()
  102. {
  103. //  firstX = 0, firstY = 0, firstMidY = 75,secondY=150;
  104.  
  105.  
  106.     iSetTimer(70, incrementY);
  107.     iInitialize(400, 600, "demooo");
  108.     return 0;
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement