SHOW:
|
|
- or go back to the newest paste.
| 1 | let counter1=0; | |
| 2 | let counter2=0; | |
| 3 | let counter3=0; | |
| 4 | let graphicangle=0; | |
| 5 | let wave=0; | |
| 6 | let turnframe1=0; | |
| 7 | let turnframe2=0; | |
| 8 | ||
| 9 | @DrawLoop{
| |
| 10 | ||
| 11 | //Fairy Graphic | |
| 12 | ||
| 13 | SetTexture(fairygraphic); | |
| 14 | SetGraphicScale(1,1); | |
| 15 | SetAlpha(255); | |
| 16 | ||
| 17 | //animation setup. | |
| 18 | ||
| 19 | if(GetSpeedX>0 && counter1==0){
| |
| 20 | Animate("fairy","turntomove",false);
| |
| 21 | graphicangle=0; | |
| 22 | - | counter3=1; |
| 22 | + | |
| 23 | counter2=0; | |
| 24 | counter3=1; //From movement to turntoidle. | |
| 25 | turnframe1=0; | |
| 26 | turnframe2=0;} | |
| 27 | ||
| 28 | if(GetSpeedX<0 && counter2==0){
| |
| 29 | Animate("fairy","turntomove",false);
| |
| 30 | graphicangle=180; | |
| 31 | - | counter3=1; |
| 31 | + | |
| 32 | counter1=0; | |
| 33 | counter3=1; //From movement to turntoidle. | |
| 34 | turnframe1=0; | |
| 35 | turnframe2=0;} | |
| 36 | ||
| 37 | - | counter3=10; |
| 37 | + | |
| 38 | Animate("fairy","idle",true);
| |
| 39 | counter3=10; //Locking the idle animation. | |
| 40 | counter2=0; | |
| 41 | counter1=0; | |
| 42 | turnframe1=0; | |
| 43 | turnframe2=0;} | |
| 44 | ||
| 45 | //Increasing turnframe value for the animations. | |
| 46 | ||
| 47 | if(GetSpeedX!=0 && turnframe1<12){
| |
| 48 | ||
| 49 | turnframe1++; | |
| 50 | ||
| 51 | } | |
| 52 | ||
| 53 | if(GetSpeedX==0 && counter3==1 && turnframe2<12){
| |
| 54 | turnframe2++; | |
| 55 | } | |
| 56 | ||
| 57 | //turntomove to move animation. | |
| 58 | ||
| 59 | if(turnframe1>10){
| |
| 60 | ||
| 61 | if(counter1==1){
| |
| 62 | Animate("fairy","move",true);
| |
| 63 | counter1++;} | |
| 64 | ||
| 65 | if(counter2==1){
| |
| 66 | Animate("fairy","move",true);
| |
| 67 | counter2++;} | |
| 68 | ||
| 69 | } | |
| 70 | ||
| 71 | //turntoidle after a movement with GetSpeedX>0 ends. | |
| 72 | ||
| 73 | if(turnframe2>1 && counter3==1){
| |
| 74 | Animate("fairy","turntoidle",false);
| |
| 75 | counter3++;} | |
| 76 | ||
| 77 | //resets back to idle after 10 frames. | |
| 78 | ||
| 79 | if(turnframe2>10 && counter3==2){
| |
| 80 | counter3=0;} | |
| 81 | ||
| 82 | //Drawing the graphic. | |
| 83 | ||
| 84 | SetColor(255,255,255); | |
| 85 | SetGraphicAngle(graphicangle,0,0); | |
| 86 | ||
| 87 | DrawAnimatedSprite("fairy", GetX, GetY);
| |
| 88 | ||
| 89 | } |