Simon Says Touchpad Framework [PS4}

Framework to use color coded combos using the share button and touchpad. hold share and drag finger over sections of the touchpad to see colors and pressing the touchpad on those colors increments a color value. pressing colors in certain amounts will correspond to your written combo. meant to work for games like mortal kombat where you can preprogram certain finishers and execute them perfectly with a simple "Blue tapped twice, Green tapped once" comes with simple examples: red=1 blue=2 for a tapped square, and red=3 green=2 for a hold square.
Version1.00
AuthorNitemareMarauder
Publish DateWed, 28 Feb 2018 - 00:16
Last UpdateWed, 28 Feb 2018 - 00:16
Downloads81
RATE


2

0

Code: Select all
 
int Choice;
int RepeatMove;
int Touch1;
int Red;
int Green;
int Blue;
int Cyan;
int Yellow;
int Magenta;
 
init {
set_led(LED_4,0);
set_led(LED_1,0);}
 
main {
set_val(TRACE_1,Red);
set_val(TRACE_2,Green);
set_val(TRACE_3,Blue);
set_val(TRACE_4,Yellow);
set_val(TRACE_5,Cyan);
set_val(TRACE_6,Magenta);
 
if (event_press(PS4_TOUCH) && Choice==1 && Touch1==1) {Red=Red+1;}
if (event_press(PS4_TOUCH) && Choice==2 && Touch1==1) {Green=Green+1;}
if (event_press(PS4_TOUCH) && Choice==3 && Touch1==1) {Blue=Blue+1;}
if (event_press(PS4_TOUCH) && Choice==4 && Touch1==1) {Yellow=Yellow+1;}
if (event_press(PS4_TOUCH) && Choice==5 && Touch1==1) {Cyan=Cyan+1;}
if (event_press(PS4_TOUCH) && Choice==6 && Touch1==1) {Magenta=Magenta+1;}
 
if (event_release(PS4_SHARE)) {combo_run(Check); Touch1=0;  set_led(LED_3,1); set_led(LED_4,1);}
if (get_val(PS4_SHARE)) {
    Touch1=1;
    set_led(LED_4,0);
    set_val(PS4_TOUCH,0);
    set_val(PS4_SHARE,0);
    RepeatMove=0;
 
    if (Choice==1) { //Red
    set_led(LED_1,0);
    set_led(LED_2,1);
    set_led(LED_3,0);
    }
    if (Choice==2) { //Green
    set_led(LED_1,0);
    set_led(LED_2,0);
    set_led(LED_3,1);
    }
    if (Choice==3) { //Blue
    set_led(LED_1,1);
    set_led(LED_2,0);
    set_led(LED_3,0);
    }
    if (Choice==4) { //Yellow
    set_led(LED_1,0);
    set_led(LED_2,1);
    set_led(LED_3,1);
    }
    if (Choice==5) { //Cyan
    set_led(LED_1,1);
    set_led(LED_2,0);
    set_led(LED_3,1);
    }
    if (Choice==6) { //Magenta
    set_led(LED_1,1);
    set_led(LED_2,1);
    set_led(LED_3,0);
    }
 
    if (ps4_touchpad(PS4T_P1Y)<0) { //Top Row
/*Red*/      if (get_val(PS4_TOUCHX)<-33.333333333) {Choice=1;}                                   
/*Green*/    if (get_val(PS4_TOUCHX)>-33.333333333 && get_val(PS4_TOUCHX)<33.333333333) {Choice=2;}
/*Blue*/     if (get_val(PS4_TOUCHX)>33.333333333) {Choice=3;}                                     
    }
    if (ps4_touchpad(PS4T_P1Y)>0) { //Bottom Row
/*Yellow*/   if (get_val(PS4_TOUCHX)<33.333333333) {Choice=4;}                                     
/*Cyan*/     if (get_val(PS4_TOUCHX)>-33.333333333 && get_val(PS4_TOUCHX)<33.333333333) {Choice=5;}
/*Magenta*/  if (get_val(PS4_TOUCHX)>33.333333333) {Choice=6;}                                     
 
    }
}
 
if (RepeatMove==1) {combo_run(MoveName);}                       //set up this condition if you want to
 //if (RepeatMove==2/3/4/5...) {combo_run(MoveName2/3/4/5...);} //repeat a move until next share press
}
combo Check {
    if (Red==1 && Blue==2) {combo_run(MoveName);} //do this to run once
    if (Red==3 && Green==2) {RepeatMove=1} //do this to run indefinetely until next share press
 
                        /*Make sure not to overlap checks, if two have the same requirements set up
                        Zero values to differentiate (eg. if (Red==2) and if (Red==2 && Blue==1) both will activate
                        so instead put (Red==2 Blue==0)*/

    Red=0;
    Green=0;
    Blue=0;
    Yellow=0;
    Cyan=0;
    Magenta=0;
//  ^^ leave these at the bottom of your combo list to refresh colors for next combo
 
}
combo MoveName {
set_val(PS4_SQUARE,100);
wait(200);
set_val(PS4_SQUARE,0);
 
 
}