Option joystick-playing

Controls walk and special-action with a joystick

State Machine

This browser can't display the SVG file svg/option_joystick-playing.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html

State stand

If that state is active,
 >  The basic behavior stand is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_joystick-playing_state_stand.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html
 
Pseudo code of the decision tree:
 
if (joystick-data.direct-special-action)   // direct special-action - button directly mapped by server
{
  
transition-to-state(kick);
}
else
{
  
if (
(abs( joystick-data.x ) > 0.2)
|| 
(abs( joystick-data.y ) > 0.2)
|| 
(abs( joystick-data.z ) > 0.2)
)   // any significant value on one of the three axis
{
  
transition-to-state(walk);
}
else
{
  
transition-to-state(stand);
}
}

State walk

If that state is active,
 >  The basic behavior walk is executed. Parameters:
 
    walk.type  =  walk-type.normal ;
    walk.speed-x  =  ((joystick-data.x * joystick-data.x) * (((sgn( joystick-data.x ) + 1) * 250) - 150)) ;
    walk.speed-y  =  (((joystick-data.y * joystick-data.y) * sgn( joystick-data.y )) * 100) ;
    walk.rotation-speed  =  (((joystick-data.z * joystick-data.z) * sgn( joystick-data.z )) * 100) ;
 
The decision tree:
  This browser can't display the SVG file svg/option_joystick-playing_state_walk.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html
 
Pseudo code of the decision tree:
 
if (joystick-data.direct-special-action)   // direct special-action - button directly mapped by server
{
  
transition-to-state(kick);
}
else
{
  
if (
(abs( joystick-data.x ) < 0.2)
&& 
(abs( joystick-data.y ) < 0.2)
&& 
(abs( joystick-data.z ) < 0.2)
)   // no significant value on any of the three axis
{
  
transition-to-state(stand);
}
else
{
  
transition-to-state(walk);
}
}

State kick

If that state is active,
 >  The basic behavior special-action is executed. Parameters:
 
    special-action-id  =  joystick-data.special-action-id ;
 
The decision tree:
  This browser can't display the SVG file svg/option_joystick-playing_state_kick.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html
 
Pseudo code of the decision tree:
 
if (joystick-data.direct-special-action)   // direct special-action - button directly mapped by server
{
  
transition-to-state(kick);
}
else
{
  
if (executed-motion-request.motion-type == special-action)   // kick in progress
{
  
transition-to-state(kick-in-progress);
}
else
{
  
transition-to-state(kick);
}
}

State kick-in-progress

If that state is active,
 >  The basic behavior stand is executed.
 
The decision tree:
  This browser can't display the SVG file svg/option_joystick-playing_state_kick-in-progress.svg.



The Adobe SVG Viewer 3.0 can be downloaded from http://www.adobe.com/svg/viewer/install/main.html
 
Pseudo code of the decision tree:
 
if (joystick-data.direct-special-action)   // direct special-action - button directly mapped by server
{
  
transition-to-state(kick);
}
else
{
  
if (
!(executed-motion-request.motion-type == special-action)
)   // kick finished
{
  
transition-to-state(stand);
}
else
{
  
transition-to-state(kick-in-progress);
}
}