Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma METAINFO("Combo, Call & Wait", 1, 0, "Ketechi")
- /*
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * * Funciones explicadas hoy: * *
- * * - import GPH (botones de mando) ... | Parte: 1 * *
- * * - Boolean (Cierto o Falso) ........ | Parte: 1 * *
- * * - combo ........................... | Parte: 2 * *
- * * - combo_pause ..................... | Parte: 2 * *
- * * - combo_restart ................... | Parte: 2 * *
- * * - combo_run ....................... | Parte: 2 * *
- * * - combo_stop ...................... | Parte: 2 * *
- * * - wait ............................ | Parte: 2 * *
- * * - call ............................ | Parte: 3 | [Manual Samuel] * *
- * * * *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- */
- #include <xb1.gph>
- // Part: 1
- bool pausado = FALSE;
- bool isActive = FALSE;
- int contador = 0;
- main {
- if(isActive)
- combo_run(contar);
- else if(get_actual(XB1_UP) <= 0.0 && get_prev(XB1_UP) >= 100.0)
- {
- isActive = !isActive;
- if(isActive)
- printf("Soy Cierto");
- else
- printf("Soy Falso");
- }
- }
- combo contar
- {
- wait(200);
- contador++;
- printf("%i", contador);
- }
- //-----------------------------------------------------------------------------
- // Parte: 2
- bool pausado = FALSE;
- main {
- // Preciona
- if(get_actual(XB1_UP) <= 0.0 && get_prev(XB1_UP) >= 100.0)
- combo_run(testing);
- else if(get_actual(XB1_DOWN) <= 0.0 && get_prev(XB1_DOWN) >= 100.0)
- combo_stop(testing);
- else if(get_actual(XB1_LEFT) <= 0.0 && get_prev(XB1_LEFT) >= 100.0)
- combo_restart(testing);
- else if(get_actual(XB1_RIGHT) <= 0.0 && get_prev(XB1_RIGHT) >= 100.0)
- combo_pause(testing)
- //pausado = !pausado;
- /*
- if(pausado)
- combo_pause(testing);
- */
- }
- combo testing
- {
- set_val(XB1_RB, 50.0);
- wait(2000);
- set_val(XB1_RT, 50.0);
- wait(2000);
- set_val(XB1_RS, 50.0);
- wait(2000);
- set_val(XB1_LB, 50.0);
- wait(2000);
- set_val(XB1_LT, 50.0);
- wait(2000);
- set_val(XB1_LS, 50.0);
- wait(2000);
- }
- //-----------------------------------------------------------------------------
- // Parte: 3
- combo todos
- {
- call(blink);
- call(respira);
- call(postura);
- }
- // Sam
- combo blink
- {
- set_val(XB1_A, 100.0);
- wait(100);
- //call(respira);
- }
- combo respira
- {
- set_val(XB1_X, 100.0);
- wait(300);
- set_val(XB1_B, 100.0);
- wait(300);
- //call(postura);
- }
- combo postura
- {
- set_val(XB1_UP, 100.0);
- wait(100);
- }
Add Comment
Please, Sign In to add comment