Advertisement
Corosus

Untitled

Oct 10th, 2011
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. //set swingArm to true to start a swing cycle
  2.  
  3. public boolean swingArm = false;
  4. public int swingTick = 0;
  5.  
  6. public void onLivingUpdate() {
  7.         super.onLivingUpdate();
  8.     if(swingArm) {
  9.             if (swingTick > 3 && swingTick < 9) {
  10.                 swingTick+=2;
  11.             } else {
  12.                 swingTick++;
  13.             }
  14.  
  15.             if(swingTick >= 24) {
  16.                 swingTick = 0;
  17.                 swingArm = false;
  18.             }
  19.         } else {
  20.             swingTick = 0;
  21.         }
  22.  
  23.         if (swingTick <= 16) {
  24.             swingProgress = (float)swingTick / 8F;
  25.         } else {
  26.             swingProgress = 0F;
  27.         }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement