Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdlib.h>
- #include<GL/glut.h>
- #include<math.h>
- #include<stdio.h>
- #include<string.h>
- #include <ctime>
- void init();
- void cube();
- void dafna();
- void dafna2();
- void ball();
- void StopBalls();
- void init_ball();
- void color_ball(float red, float green, float blue);
- int rot = 0, rot2 = 0, rot3 = 0, flag = 0, flag1 = 1, flag3 = 0, flag4, flag5 = 0, arrlenght = 9;
- int temp, reflex = 0, score = 0, start = 1;
- int temp_score;
- char s[10], str[100], *str2;
- float a = 15, aC, xC, zC, dis, speed = 0.005, tempS, rot_temp = 0;
- int fr[9] = { 0 }, fl[9] = { 0 }, fi[9] = { 0 }, fo[9] = { 0 };
- //clock_t starttime = clock();
- //clock_t endtime;
- double duration;
- typedef struct {
- float x;
- float y;
- float z;
- float red;
- float green;
- float blue;
- int status;
- int flag;
- }Ball;
- Ball balls[9];
- void reset() // reset all values when starting new game
- {
- rot = 0;
- rot2 = 0; rot3 = 0; flag = 0; flag1 = 1; flag3 = 0; flag5 = 0;
- reflex = 0;
- start = 1; a = 15; speed = 0.005; rot_temp = 0;
- }
- void up() // When new game starts the table going up
- {
- rot_temp += 0.03;
- if (rot_temp >= 1.0)
- {
- rot2 += 1.0;
- rot_temp = 0;
- }
- if (rot2 >= 60)
- {
- flag5 = 1;
- //starttime = clock();
- }
- }
- void print_score() /// and timer
- {
- sprintf(str, "Score : %d", score);
- str2 = str;
- glColor3f(1.0, 1.0, 0.0);
- glRasterPos3f(-9, 10, 0);
- do glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, *str2);
- while (*(++str2));
- if (flag5) { /// when the table stop moving up
- //endtime = clock();
- //duration = (endtime - starttime) / (double)CLOCKS_PER_SEC;
- //sprintf(str, "Timer : %0.f", 60.0 - duration);
- str2 = str;
- glColor3f(0.0, 0.0, 1.0);
- glRasterPos3f(-8.5, 11, 0);
- do glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, *str2);
- while (*(++str2));
- if (duration >= 60) {
- StopBalls();
- reset();
- }
- }
- }
- int move_x(int i)
- {
- int j;
- for (j = 0; j<arrlenght; j++)
- {
- if (j != i && balls[j].flag == 0) {
- if (balls[i].x >= balls[j].x - 0.6 && balls[i].x <= balls[j].x + 0.6 && balls[i].z >= balls[j].z - 0.6 && balls[i].z <= balls[j].z + 0.6)
- return j;
- }
- }
- return -1;
- }
- void StopBalls() // Stop's Balls Moving
- {
- balls[0].status = 1;
- for (int i = 0; i < arrlenght; i++)
- {
- if (i != 0)
- balls[i].status = 0;
- fr[i] = 0;
- fl[i] = 0;
- fi[i] = 0;
- fo[i] = 0;
- }
- }
- void checkgame() /// To Check if All the Ball's are inserted to the hools (End Game)
- {
- for (int i = 1; i < 9 && balls[i].flag == 1; i++)
- if (i == 8)
- {
- StopBalls();
- reset();
- }
- }
- void keyboard(unsigned char key, int x, int y)
- {
- if (key == 27) exit(1);
- if (key == 'n' && start == 1)
- {
- init_ball();
- start = 0;
- score = 0;
- } ///
- if (key == 'd')
- {
- rot += 5;
- rot %= 360;
- } ///
- if (key == 'w')
- {
- rot2 += 5;
- rot2 %= 360;
- } ///
- if (key == 's')
- {
- rot2 -= 5;
- rot2 %= 360;
- } ///
- if (key == 'b')
- {
- StopBalls();
- reset();
- start = 1;
- } ///
- if (key == 'a')
- {
- rot -= 5;
- rot %= 360;
- } ///
- if (key == 'z')
- {
- rot3 += 5;
- rot3 %= 360;
- } ///
- if (key == 'x')
- {
- rot3 -= 5;
- rot3 %= 360;
- } ///
- if (key == '6')//d
- {
- fr[0] = 1;
- fl[0] = 0;
- } ///
- if (key == '4')//a
- {
- fl[0] = 1;
- fr[0] = 0;
- } ///
- if (key == '8')//w
- {
- fi[0] = 0;
- fo[0] = 1;
- } ///
- if (key == '2')//s
- {
- fo[0] = 0;
- fi[0] = 1;
- } ///
- if (key == '5')
- {
- StopBalls();
- } ///
- if (key == '+') // increase ball speed
- {
- flag4 = 0;
- if (speed < 0.025) {
- for (int i = 1; i < 9; i++)
- {
- if (balls[i].status == 1)
- flag4 = 1;
- }
- if (flag4 == 0)
- speed = speed + 0.002;
- }
- } ///
- if (key == '-') // slow ball speed
- {
- flag4 = 0;
- if (speed > 0.005) {
- for (int i = 1; i < 9; i++)
- {
- if (balls[i].status == 1)
- flag4 = 1;
- }
- if (flag4 == 0)
- speed = speed - 0.002;
- }
- } ///
- glutPostRedisplay();
- }
- void draw()
- {
- glClear(GL_COLOR_BUFFER_BIT |
- GL_DEPTH_BUFFER_BIT);
- glLoadIdentity();
- glTranslatef(0, -15, -30);
- glRotatef(rot, 0, 1, 0);
- glRotatef(rot2, 1, 0, 0);
- glRotatef(rot3, 0, 0, 1);
- /************************************************************/
- //if (start == 1)
- //{
- // ////str2 = "Press N To Start New Game";
- // //glColor3f(1.0, 1.0, 0.0);
- // //glRasterPos3f(-8, 15, 0);
- // //do glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, *str2);
- // //while (*(++str2));
- // //sprintf(str, "Your Score : %d", score);
- // //str2 = str;
- // //glColor3f(1.0, 1.0, 0.0);
- // //glRasterPos3f(-6, 19, 0);
- // //do glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, *str2);
- // //while (*(++str2));
- //}
- if (start == 0)
- {
- if (!flag5)
- up();
- checkgame();
- glTranslatef(0, 4, -12);
- glColor3f(1, 1, 0.8);
- // Floor
- glBegin(GL_QUADS);
- glNormal3f(0, 1, 0); // normal straight up
- glVertex3f(-20, 0, -25);
- glVertex3f(20, 0, -25);
- glVertex3f(20, 0, 25);
- glVertex3f(-20, 0, 25);
- glEnd();
- glColor3f(0.2, 0.7, 0.3);
- glTranslatef(0, 8, 0);
- // Table
- glBegin(GL_QUADS);
- glNormal3f(0, 1, 0); // normal straight up
- glVertex3f(-9, 0, -12);
- glVertex3f(9, 0, -12);
- glVertex3f(9, 0, 12);
- glVertex3f(-9, 0, 12);
- glEnd();
- // Table Legs
- glColor3f(0.2, 0.2, 0.5);
- glTranslatef(-8.5, 0, 11.5);
- cube();
- glTranslatef(0, 0, -23);
- cube();
- glTranslatef(17, 0, 0);
- cube();
- glTranslatef(0, 0, 23);
- cube();
- glTranslatef(-8.5, 0, -11.5); // 0 point
- print_score();
- //Walls//
- glColor3f(0.6, 0.6, 0.6);
- glBegin(GL_QUADS);
- glNormal3f(0, 1, 0); // normal straight up
- glVertex3f(-20, -8, -25);
- glVertex3f(20, -8, -25);
- glVertex3f(20, 20, -25);
- glVertex3f(-20, 20, -25);
- glEnd();
- glBegin(GL_QUADS);
- glNormal3f(0, 1, 0); // normal straight up
- glVertex3f(-20, -8, -25);
- glVertex3f(-20, 20, -25);
- glVertex3f(-20, 20, 25);
- glVertex3f(-20, -8, 25);
- glEnd();
- glBegin(GL_QUADS);
- glNormal3f(0, 1, 0); // normal straight up
- glVertex3f(20, -8, -25);
- glVertex3f(20, 20, -25);
- glVertex3f(20, 20, 25);
- glVertex3f(20, -8, 25);
- glEnd();
- // Dafnot //
- glColor3f(0.4, 0.3, 0.1);
- glTranslatef(0, 0, -11.5);
- dafna();
- glTranslatef(0, 0, 23);
- dafna();
- glTranslatef(8.5, 0, -11.5);
- dafna2();
- glTranslatef(-17, 0, 0);
- dafna2();
- glTranslatef(8.5, 0, 0); // 0 point
- // Hools //
- glColor3f(1, 0, 0);
- glTranslatef(6.5, 0.1, 9.5);
- glBegin(GL_POLYGON);
- for (int i = 0; i <= 720; i++) {
- aC = 3.14 * i;
- xC = cos(aC / 360);
- zC = sin(aC / 360);
- glVertex3d(xC, 0, zC);
- }
- glEnd();
- ///////////////////////////////////////////
- glColor3f(0, 0, 0);
- glTranslatef(-13, 0, 0);
- glBegin(GL_POLYGON);
- for (int i = 0; i <= 720; i++) {
- aC = 3.14 * i;
- xC = cos(aC / 360);
- zC = sin(aC / 360);
- glVertex3d(xC, 0, zC);
- }
- glEnd();
- ///////////////////////////////////////////
- glColor3f(1, 0, 0);
- glTranslatef(0, 0, -19);
- glBegin(GL_POLYGON);
- for (int i = 0; i <= 720; i++) {
- aC = 3.14 * i;
- xC = cos(aC / 360);
- zC = sin(aC / 360);
- glVertex3d(xC, 0, zC);
- }
- glEnd();
- ///////////////////////////////////////////
- glColor3f(0, 0, 0);
- glTranslatef(13, 0, 0);
- glBegin(GL_POLYGON);
- for (int i = 0; i <= 720; i++) {
- aC = 3.14 * i;
- xC = cos(aC / 360);
- zC = sin(aC / 360);
- glVertex3d(xC, 0, zC);
- }
- glEnd();
- ///////////Draw Balls/////////////
- glTranslatef(-6.5, -0.1, 9.5); // 0 point
- glTranslatef(0, 0.3, 0); // ball's radius
- for (int i = 0; i < arrlenght; i++)
- {
- glTranslatef(balls[i].x, balls[i].y, balls[i].z);
- color_ball(balls[i].red, balls[i].green, balls[i].blue);
- glTranslatef(-balls[i].x, -balls[i].y, -balls[i].z);
- }
- glTranslatef(0, -0.3, 0);
- }
- glutSwapBuffers(); // display the output
- }
- void Checkflag(int i) // to check if a ball hit a holl
- {
- if (balls[i].flag == 0) { // to check if the ball still in the game
- dis = sqrt(pow(balls[i].x - (-6.5), 2) + pow(balls[i].z - 9.5, 2));
- if (dis < 0.9) {
- if (i) {
- score -= 10;
- balls[i].flag = 2;
- balls[i].status = 0;
- printf("%d\n", score);
- }
- else {
- score -= 5;
- balls[0].x = balls[0].x + 5;
- fr[i] = 0;
- fl[i] = 0;
- fi[i] = 0;
- fo[i] = 0;
- printf("%d\n", score);
- }
- }
- dis = sqrt(pow(balls[i].x - (6.5), 2) + pow(balls[i].z - 9.5, 2));
- if (dis < 0.9) {
- if (i) {
- score += 10;
- balls[i].flag = 2;
- balls[i].status = 0;
- printf("%d\n", score);
- }
- else {
- score -= 5;
- balls[0].x = balls[0].x - 5;
- fr[i] = 0;
- fl[i] = 0;
- fi[i] = 0;
- fo[i] = 0;
- printf("%d\n", score);
- }
- }
- dis = sqrt(pow(balls[i].x - (-6.5), 2) + pow(balls[i].z - (-9.5), 2));
- if (dis < 0.9) {
- if (i) {
- score += 10;
- balls[i].flag = 2;
- balls[i].status = 0;
- printf("%d\n", score);
- }
- else {
- score -= 5;
- balls[0].x = balls[0].x + 5;
- fr[i] = 0;
- fl[i] = 0;
- fi[i] = 0;
- fo[i] = 0;
- printf("%d\n", score);
- }
- }
- dis = sqrt(pow(balls[i].x - (6.5), 2) + pow(balls[i].z - (-9.5), 2));
- if (dis < 0.9) {
- if (i) {
- score -= 10;
- balls[i].flag = 2;
- balls[i].status = 0;
- printf("%d\n", score);
- }
- else {
- score -= 5;
- balls[0].x = balls[0].x - 5;
- fr[i] = 0; // reset the flags
- fl[i] = 0;
- fi[i] = 0;
- fo[i] = 0;
- printf("%d\n", score);
- }
- }
- }
- }
- void Idle()
- {
- for (int i = 0; i < arrlenght; i++) {
- Checkflag(i); // check if the ball hit a hole
- if (balls[i].flag == 0) { /// check of the ball still in the table
- if (fr[i]) // each ball have her own flags
- {
- if (balls[i].status == 1 && move_x(i) == -1)
- if (balls[i].x < 7.7)
- balls[i].x += speed;
- else {
- fl[i] = 1;
- fr[i] = 0;
- }
- if (balls[i].status == 1 && move_x(i) != -1) {
- temp = move_x(i);
- balls[temp].status = 1;
- fr[temp] = 1;
- fl[temp] = 0;
- //reflex = 1;
- balls[i].x -= speed;
- fl[i] = 1;
- fr[i] = 0;
- if (fo[i] == 1)
- fo[temp] = 1;
- if (fi[i] == 1)
- fi[temp] = 1;
- }
- }
- if (fl[i])
- {
- if (balls[i].status == 1 && move_x(i) == -1)
- if (balls[i].x > -7.7)
- balls[i].x -= speed;
- else {
- fl[i] = 0;
- fr[i] = 1;
- }
- if (balls[i].status == 1 && move_x(i) != -1) {
- temp = move_x(i);
- balls[temp].status = 1;
- fr[temp] = 0;
- fl[temp] = 1;
- reflex = 1;
- balls[i].x += speed;
- fl[i] = 0;
- fr[i] = 1;
- if (fo[i] == 1)
- fo[temp] = 1;
- if (fi[i] == 1)
- fi[temp] = 1;
- }
- }
- if (fo[i])
- {
- if (balls[i].status == 1 && move_x(i) == -1)
- if (balls[i].z > -10.7)
- balls[i].z -= speed;
- else
- {
- fo[i] = 0;
- fi[i] = 1;
- }
- if (balls[i].status == 1 && move_x(i) != -1) {
- temp = move_x(i);
- balls[temp].status = 1;
- fo[temp] = 1;
- fi[temp] = 0;
- balls[i].z += speed;
- reflex = 1;
- fi[i] = 1;
- fo[i] = 0;
- if (fl[i] == 1)
- fl[temp] = 1;
- if (fr[i] == 1)
- fr[temp] = 1;
- }
- }
- if (fi[i])
- {
- if (balls[i].status == 1 && move_x(i) == -1)
- if (balls[i].z < 10.7)
- balls[i].z += speed;
- else
- {
- fo[i] = 1;
- fi[i] = 0;
- }
- if (balls[i].status == 1 && move_x(i) != -1) {
- temp = move_x(i);
- balls[temp].status = 1;
- fo[temp] = 0;
- fi[temp] = 1;
- balls[i].z -= speed;
- reflex = 1;
- fi[i] = 0;
- fo[i] = 1;
- if (fl[i] == 1)
- fl[temp] = 1;
- if (fr[i] == 1)
- fr[temp] = 1;
- }
- }
- }
- if (balls[i].flag == 2)
- {
- balls[i].y = balls[i].y - 0.002;
- if (balls[i].y <-7.7)
- balls[i].flag = 1;
- }
- }
- if (reflex) { // if a ball hit another ball reflex=1
- if (a > 0) {
- if (flag3 == 0) {
- tempS = speed; // saving the speed
- printf("%f\n", tempS);
- flag3 = 1;
- printf("here\n");
- }
- a -= tempS;
- speed = speed - (0.0007*speed);
- if (flag1 && a < 10) {
- balls[0].status = 0;
- flag1 = 0;
- }
- }
- else { // stop ball's moving
- speed = tempS; // return speed
- a = 15;
- flag1 = 1;
- flag3 = 0;
- StopBalls();
- reflex = 0;
- }
- }
- draw();
- }
- int main(int argc, char *argv[])
- {
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); // RGB display, double-buffered, with Z-Buffer
- glutInitWindowSize(600, 600); // 500 x 500 pixels
- glutCreateWindow("3D");
- glutDisplayFunc(draw); // Set the display function
- glutKeyboardFunc(keyboard); // Set the keyboard function
- init();
- init_ball();
- glutIdleFunc(Idle);
- glutMainLoop(); // Start the main event loop
- }
- // Set OpenGL parameters
- void init()
- {
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(60, 1.0, 0.1, 100);
- glMatrixMode(GL_MODELVIEW);
- // Lighting parameters
- GLfloat mat_ambdif[] = { 1.0,2.0, 0.0, 1.0 };
- GLfloat mat_specular[] = { 0.0, 0.0, 0.0, 1.0 };
- GLfloat mat_shininess[] = { 80.0 };
- GLfloat light_position[] = { 0.0, 5.0, 0.0, 1.0 };
- glClearColor(0.0, 0.0, 0.0, 0.0);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_ambdif); // set both amb and diff components
- glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); // set specular
- glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); // set shininess
- glLightfv(GL_LIGHT0, GL_POSITION, light_position); // set light "position", in this case direction
- glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); // active material changes by glColor3f(..)
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_COLOR_MATERIAL);
- glEnable(GL_DEPTH_TEST);
- }
- void cube()
- {
- glBegin(GL_QUADS);
- // Front
- glNormal3f(0, 0, 1);
- glVertex3f(-0.5, 0, 0.5);
- glVertex3f(-0.5, -8, 0.5);
- glVertex3f(0.5, -8, 0.5);
- glVertex3f(0.5, 0, 0.5);
- // Back
- glNormal3f(0, 0, 1);
- glVertex3f(-0.5, 0, -0.5);
- glVertex3f(0.5, 0, -0.5);
- glVertex3f(0.5, -8, -0.5);
- glVertex3f(-0.5, -8, -0.5);
- // Left side
- glNormal3f(1, 0, 0);
- glVertex3f(-0.5, 0, 0.5);
- glVertex3f(-0.5, -8, 0.5);
- glVertex3f(-0.5, -8, -0.5);
- glVertex3f(-0.5, 0, -0.5);
- // Right side
- glNormal3f(1, 0, 0);
- glVertex3f(0.5, 0, 0.5);
- glVertex3f(0.5, 0, -0.5);
- glVertex3f(0.5, -8, -0.5);
- glVertex3f(0.5, -8, 0.5);
- glEnd();
- }
- void dafna()
- {
- glBegin(GL_QUADS);
- // Front
- glNormal3f(0, 0, 1);
- glVertex3f(-9, 0, 0.5);
- glVertex3f(-9, 0.6, 0.5);
- glVertex3f(9, 0.6, 0.5);
- glVertex3f(9, 0, 0.5);
- // Back
- glNormal3f(0, 0, 1);
- glVertex3f(-9, 0, -0.5);
- glVertex3f(9, 0, -0.5);
- glVertex3f(9, 0.6, -0.5);
- glVertex3f(-9, 0.6, -0.5);
- // Left side
- glNormal3f(-1, 0, 0);
- glVertex3f(-9, 0, 0.5);
- glVertex3f(-9, 0.6, 0.5);
- glVertex3f(-9, 0.6, -0.5);
- glVertex3f(-9, 0, -0.5);
- // Right side
- glNormal3f(1, 0, 0);
- glVertex3f(9, 0, 0.5);
- glVertex3f(9, 0, -0.5);
- glVertex3f(9, 0.6, -0.5);
- glVertex3f(9, 0.6, 0.5);
- // Up side
- glNormal3f(1, 0, 0);
- glVertex3f(9, 0.6, 0.5);
- glVertex3f(9, 0.6, -0.5);
- glVertex3f(-9, 0.6, -0.5);
- glVertex3f(-9, 0.6, 0.5);
- glEnd();
- }
- void dafna2()
- {
- glBegin(GL_QUADS);
- // Front
- glNormal3f(1, 0, 0.5);
- glVertex3f(-0.5, 0, 12);
- glVertex3f(-0.5, 0.6, 12);
- glVertex3f(0.5, 0.6, 12);
- glVertex3f(0.5, 0, 12);
- // Back
- glNormal3f(0, 0, 1);
- glVertex3f(-0.5, 0, -12);
- glVertex3f(-0.5, 0.6, -12);
- glVertex3f(0.5, 0.6, -12);
- glVertex3f(0.5, 0, -12);
- // Left side
- glNormal3f(1, 0, 0);
- glVertex3f(-0.5, 0, -12);
- glVertex3f(-0.5, 0.6, -12);
- glVertex3f(-0.5, 0.6, 12);
- glVertex3f(-0.5, 0, 12);
- // Right side
- glNormal3f(1, 0, 0);
- glVertex3f(0.5, 0, -12);
- glVertex3f(0.5, 0.6, -12);
- glVertex3f(0.5, 0.6, 12);
- glVertex3f(0.5, 0, 12);
- // Up side
- glNormal3f(0, 1, 0);
- glVertex3f(0.5, 0.6, 12);
- glVertex3f(0.5, 0.6, -12);
- glVertex3f(-0.5, 0.6, -12);
- glVertex3f(-0.5, 0.6, 12);
- glEnd();
- }
- void ball()
- {
- glutSolidSphere(0.3, 32, 32);
- }
- void color_ball(float red, float green, float blue)
- {
- glColor3f(red, green, blue);
- ball();
- }
- void init_ball()
- {
- balls[0].x = 0;
- balls[0].y = 0;
- balls[0].z = -5;
- balls[0].red = 1;
- balls[0].green = 1;
- balls[0].blue = 1;
- balls[0].status = 1;
- balls[0].flag = 0;
- ////////////////////////////
- balls[1].x = 0;
- balls[1].y = 0;
- balls[1].z = 0;
- balls[1].red = 0;
- balls[1].green = 0;
- balls[1].blue = 1;
- balls[1].status = 0.9;
- balls[1].flag = 0;
- ////////////////////////////
- balls[2].x = -1;
- balls[2].y = 0;
- balls[2].z = 2;
- balls[2].red = 1;
- balls[2].green = 0;
- balls[2].blue = 0;
- balls[2].status = 0.8;
- balls[2].flag = 0;
- ////////////////////////////
- balls[3].x = 1;
- balls[3].y = 0;
- balls[3].z = 2;
- balls[3].red = 0;
- balls[3].green = 1;
- balls[3].blue = 0.0;
- balls[3].status = 0.7;
- balls[3].flag = 0;
- ////////////////////////////
- balls[4].x = -4;
- balls[4].y = 0;
- balls[4].z = 4;
- balls[4].red = 0.8;
- balls[4].green = 0.6;
- balls[4].blue = 0.2;
- balls[4].status = 0.6;
- balls[4].flag = 0;
- ////////////////////////////
- balls[5].x = 4;
- balls[5].y = 0;
- balls[5].z = 4;
- balls[5].red = 0.2;
- balls[5].green = 0.5;
- balls[5].blue = 0.86;
- balls[5].status = 0.5;
- balls[5].flag = 0;
- ////////////////////////////
- balls[6].x = 0;
- balls[6].y = 0;
- balls[6].z = 4;
- balls[6].red = 0.2;
- balls[6].green = 0.7;
- balls[6].blue = 0.7;
- balls[6].status = 0.5;
- balls[6].flag = 0;
- ////////////////////////////
- balls[7].x = -6;
- balls[7].y = 0;
- balls[7].z = 6;
- balls[7].red = 0.3;
- balls[7].green = 0.1;
- balls[7].blue = 0.6;
- balls[7].status = 0.3;
- balls[7].flag = 0;
- ////////////////////////////
- balls[8].x = 6;
- balls[8].y = 0;
- balls[8].z = 6;
- balls[8].red = 0.8;
- balls[8].green = 0.6;
- balls[8].blue = 0.2;
- balls[8].status = 0.2;
- balls[8].flag = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement