void movementa() { srand(time(0)); cout<<"Player 2: ROLL"<<endl; player2.move=rand()%8+1; wait(.85); cout<<"Player 2 rolled a "<<player2.move<<"!"<<endl; wait(1); if(player2.move<=(11-player2.y)) { reseta(); player2.y=player2.y+player2.move; chutes(); ladders(); board[player2.x][player2.y]='R'; } else { reseta(); player2.move=player2.move-(11-player2.y); player2.x=player2.x-1; player2.y=player2.move-1; chutes(); ladders(); board[player2.x][player2.y]='R'; } }
void Fase_TheVengeanceWeapon::inicializa() { reseta(); definePersonagens(); EfeitoSonoro::getInstance().initAudios_TheVengeanceWeapon(); EfeitoSonoro::getInstance().playMainTheme(); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); PontosCeu[0][0] = -35; PontosCeu[0][1] = 30; PontosCeu[1][0] = -5; PontosCeu[1][1] = 15; PontosCeu[2][0] = 25; PontosCeu[2][1] = 30; PontosCeu[4][0] = -5; PontosCeu[4][1] = 20; PontosCeu[5][0] = -40; PontosCeu[5][1] = -25; PontosCeu[6][0] = 35; PontosCeu[6][1] = -30; PontosCeu[7][0] = -5; PontosCeu[7][1] = -45; for (int i = 8; i < 14; i++){ PontosCeu[i][0] = PontosCeu[i - 7][0]; PontosCeu[i][1] = PontosCeu[i - 7][1] + 100; } }
void Fase_TheBlitz::inicializa() { reseta(); EfeitoSonoro::getInstance().initAudios_TheBlitz(); EfeitoSonoro::getInstance().playMainTheme(); definePersonagens(); EfeitoSonoro::getInstance().playAirRaid(); EfeitoSonoro::getInstance().playSpitfireMotor(); }
int main() { create_connect(); go(457.2,250); resetd(); while (get_create_total_angle(10) < 90) {turnl(250);} reseta(); go(457.2,250); resetd(); while (get_create_total_angle(10) > -90) {turnr(250);} reseta(); go(250,250); while (get_create_total_angle(10) > -90)//Riddhi..your job is to write a //function like mine, go, that makes an easy command to turn the robot. {turnr(250);} reseta(); go(400,250); resetd(); motor(3,50); sleep(1.5);//this is to lower the cage thing for the green //and pink containers. might have to go forward or backward. go(-400,250);//to go backwards resetd(); while (get_create_total_angle(10) < 90) {turnl(250);} reseta(); go(-457.2,250); resetd(); //need help with steps 13-21 on the pseudocode. while (analog(2) < 100) {create_drive_straight(250);} //to raise the cage, and leave the filled containers of luggage. motor(3,50); sleep(1.5); enable_servos(); get_servo_position(2); if (get_servo_position(2) > 1023) {set_servo_position(2,get_servo_position(2)-1023);} if (get_servo_position(2) < 1023) {set_servo_position(2,get_servo_position(2)+1023);} }
/** função passada como callback para glutKeyboardFunc para tratamento de teclas do teclado **/ void keyboardHandler(unsigned char key, int x, int y) { switch (key) { case 'w': reseta(&rotacaoMundoX, &rotacaoMundoY, &rotacaoMundoZ); rotacaoMundoX = 2; break; case 's': reseta(&rotacaoMundoX, &rotacaoMundoY, &rotacaoMundoZ); rotacaoMundoX = -2; break; case 'd': reseta(&rotacaoMundoX, &rotacaoMundoY, &rotacaoMundoZ); rotacaoMundoY = 2; break; case 'a': reseta(&rotacaoMundoX, &rotacaoMundoY, &rotacaoMundoZ); rotacaoMundoY = -2; break; case 'q': reseta(&rotacaoMundoX, &rotacaoMundoY, &rotacaoMundoZ); rotacaoMundoZ = 2; break; case 'e': reseta(&rotacaoMundoX, &rotacaoMundoY, &rotacaoMundoZ); rotacaoMundoZ = -2; break; default: break; } glutPostRedisplay(); }
/** faz a chamada de todas as modelagens do cenario **/ void modeloJuncao() { init(); glRotatef(rotacaoMundoX, 1.0, .0, .0); glRotatef(rotacaoMundoY, .0, 1.0, .0); glRotatef(rotacaoMundoZ, .0, .0, 1.0); reseta(&rotacaoMundoX, &rotacaoMundoY, &rotacaoMundoZ); glPushMatrix(); modeloCenario(); glPopMatrix(); int i; /*Troncos*/ for(i = 0; i < 4; i++){ glPushMatrix(); glTranslatef(movimentoTronco[i], 0, 0); glTranslatef(0, 0, 2 * i); modeloTronco(angle, delta); glPopMatrix(); } /*Carros*/ for(i = 0; i < 5; i++){ glPushMatrix(); glTranslatef(movimentoCarro[i], 0, 0); glTranslatef(0, 0.33, - 2 * i); glColor3f(1.0, 0.4, 0.2); modeloCarro(angle, delta); glPopMatrix(); } /*Sapo*/ glPushMatrix(); glTranslatef(movimentoSapoH, 0, movimentoSapoV); modeloSapo(anguloSapo); glPopMatrix(); /** sapos estaticos dos portais **/ // sapo do portal 5 if (sapoChegou[4] == 1) { glPushMatrix(); glTranslatef(11.0, .01, 11.0); glScalef(2, 2, 2); glTranslatef(0.5, 0, 10.5); modeloSapoEstatico(); glPopMatrix(); } // sapo do portal 4 if (sapoChegou[3] == 1) { glPushMatrix(); glTranslatef(5.0, .01, 11.0); glScalef(2, 2, 2); glTranslatef(0.5, 0, 10.5); modeloSapoEstatico(); glPopMatrix(); } glPopMatrix(); // sapo do portal 3 if (sapoChegou[2] == 1) { glPushMatrix(); glTranslatef(-1.0, .01, 11.0); glScalef(2, 2, 2); glTranslatef(0.5, 0, 10.5); modeloSapoEstatico(); glPopMatrix(); } // sapo do portal 2 if (sapoChegou[1] == 1) { glPushMatrix(); glTranslatef(-7.0, .01, 11.0); glScalef(2, 2, 2); glTranslatef(0.5, 0, 10.5); modeloSapoEstatico(); glPopMatrix(); } // sapo do portal 1 if (sapoChegou[0] == 1) { glPushMatrix(); glTranslatef(-13.0, .01, 11.0); glScalef(2, 2, 2); glTranslatef(0.5, 0, 10.5); modeloSapoEstatico(); glPopMatrix(); } glFlush(); //glutSwapBuffers(); }