Advertisement
fig02

pause stick logic

Nov 13th, 2023
608
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.28 KB | None | 0 0
  1.             if (pauseCtx->stickAdjX < -30) {
  2.                 if (sStickXRepeatState == -1) {
  3.                     sStickXRepeatTimer--;
  4.                     if (sStickXRepeatTimer < 0) {
  5.                         sStickXRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY; // 2 frames
  6.                     } else {
  7.                         pauseCtx->stickAdjX = 0;
  8.                     }
  9.                 } else {
  10.                     sStickXRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY_FIRST; // 10 frames
  11.                     sStickXRepeatState = -1;
  12.                 }
  13.             } else if (pauseCtx->stickAdjX > 30) {
  14.                 if (sStickXRepeatState == 1) {
  15.                     sStickXRepeatTimer--;
  16.                     if (sStickXRepeatTimer < 0) {
  17.                         sStickXRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY;
  18.                     } else {
  19.                         pauseCtx->stickAdjX = 0;
  20.                     }
  21.                 } else {
  22.                     sStickXRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY_FIRST;
  23.                     sStickXRepeatState = 1;
  24.                 }
  25.             } else {
  26.                 sStickXRepeatState = 0;
  27.             }
  28.  
  29.             if (pauseCtx->stickAdjY < -30) {
  30.                 if (sStickYRepeatState == -1) {
  31.                     sStickYRepeatTimer--;
  32.                     if (sStickYRepeatTimer < 0) {
  33.                         sStickYRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY;
  34.                     } else {
  35.                         pauseCtx->stickAdjY = 0;
  36.                     }
  37.                 } else {
  38.                     sStickYRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY_FIRST;
  39.                     sStickYRepeatState = -1;
  40.                 }
  41.             } else if (pauseCtx->stickAdjY > 30) {
  42.                 if (sStickYRepeatState == 1) {
  43.                     sStickYRepeatTimer--;
  44.                     if (sStickYRepeatTimer < 0) {
  45.                         sStickYRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY;
  46.                     } else {
  47.                         pauseCtx->stickAdjY = 0;
  48.                     }
  49.                 } else {
  50.                     sStickYRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY_FIRST;
  51.                     sStickYRepeatState = 1;
  52.                 }
  53.             } else {
  54.                 sStickYRepeatState = 0;
  55.             }
  56.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement