Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 38.67 KB | None | 0 0
  1. if(!isObject(EnemyMcGeeManagerBehavior))
  2. {
  3.     %template = new BehaviorTemplate(EnemyMcGeeManagerBehavior);
  4.    
  5.     %template.friendlyName = "EnemyMcGeeManagerBehavior";
  6.     %template.description = "EnemyMcGeeManagerBehavior";
  7.     %template.behaviorType = "Enemy Manager Behavior";
  8.    
  9.     %template.addBehaviorField(Chip, "", object, "Chip", t2dSceneObject);
  10.     %template.addBehaviorField(enemy, "", object, "enemy", t2dSceneObject);    
  11.    
  12.     %template.addBehaviorField(strawberry, "", object, "strawberry", t2dSceneObject);  
  13.        
  14.     //readyStartGo
  15.     %template.addBehaviorField(readyStartGo, "", object, "readyStartGo", t2dSceneObject);  
  16.        
  17.     ///timerBar
  18.     %template.addBehaviorField(timerBar, "", object, "timerBar", t2dSceneObject);  
  19.     ///timesUp
  20.     %template.addBehaviorField(timesUp, "", object, "timesUp", t2dSceneObject);
  21.    
  22.     %template.addBehaviorField(vs, "", object, "vs", t2dSceneObject);
  23.    
  24.    
  25.    
  26.        
  27. }
  28.  
  29. function EnemyMcGeeManagerBehavior::onLevelLoaded(%this)
  30. {
  31.     $s1L1 = true;
  32.     $s1L1Prize = 50;
  33.    
  34.     $s1L2 = false;
  35.     $s1L3 = false;
  36.    
  37.     %this.owner.enableUpdateCallback();
  38.  
  39.     %this.createEnemy();
  40.    
  41.     %this.schedule(1000, echoFind);
  42.    
  43.     $dummyEChip = %this.dummyEChip;
  44.    
  45.     $EnemyOutOfChips = false;
  46.    
  47.     //a gauge to make sure no enemy chips are doubled up in creation.
  48.     $newEnemyChipCreated = false;
  49.    
  50.     $gameIsUp = false;
  51.    
  52.    
  53.     $BirdInAction = true;
  54.    
  55.    
  56.     $GameOn = false;
  57.    
  58.     ///callls round intros, countdown etc
  59.     %this.schedule(2000, readyStartGo0);
  60.     $readyStartGo = %this.readyStartGo;
  61.     $vs = %this.vs;
  62.    
  63.    
  64.     ////timer function and objects
  65.     ///%this.timer();
  66.     $timerBar = %this.timerBar;
  67.     $timesUp = %this.timesUp;
  68.    
  69.    
  70.     ///this, the chipInAnee, is created here. as it is a perment fixture in the game.
  71.     ///previously created always on create new chip.
  72.     $EnemyChipInAnee = new t2dAnimatedSprite(EnemyChipInAnee)
  73.     {
  74.         scenegraph = %this.owner.scenegraph;
  75.         animationName = "chipInAneeAnimation";
  76.         mUseSourceRect = "0";
  77.         sourceRect = "0 0 0 0";
  78.         canSaveDynamicFields = "1";
  79.         layer = "31";
  80.         Position = "-134.322 -82.357";
  81.         size = "18.270 36.540";
  82.         usesPhysics = "0";
  83.         CollisionActiveSend = "0";
  84.         CollisionActiveReceive = "0";
  85.         CollisionPhysicsSend = "0";
  86.         CollisionCallback = "0";
  87.         CollisionCircleScale = "0.1";
  88.         CollisionMaxIterations = "0";
  89.         BlendColor = "0.000000 0.815686 0.070588 1.000000";
  90.         MountOwned = "0";
  91.         MountInheritAttributes = "0";
  92.         mountID = "41";
  93.         mountToID = "40";
  94.         group = 27;
  95.     };
  96.            
  97.    
  98. }
  99.    
  100.    
  101.    
  102.    
  103. function EnemyMcGeeManagerBehavior::echoFind(%this)
  104. {
  105.     echo("::::  :::  :: : : : ::  :::   ::::");
  106.     echo("$Bank " @ $Bank );   
  107.     echo("::::  :::  :: : : : ::  :::   ::::.....");
  108.     %this.schedule(1000, echoFind);
  109. }
  110.  
  111.  
  112.  
  113.  
  114. ////THIS IS THE READYSTARTGO!!!!
  115.  
  116. function EnemyMcGeeManagerBehavior::readyStartGo0(%this)
  117. {  
  118.     ///manage, set readySartGo
  119.     %this.vs.setLayer(10);
  120.     %this.readyStartGo.setLayer(1);
  121.     %this.readyStartGo.setFrame(0);
  122.     %this.schedule(1500, readySartGo1);
  123.    
  124.    
  125.     ///turn Chip's controls off
  126.     $noControl = true;
  127.    
  128.     $Enemy.setFlipX(false);
  129.    
  130.     echo("in the VS shiiiitttt");
  131. }
  132.  
  133. function EnemyMcGeeManagerBehavior::readySartGo1(%this)
  134. {
  135.     %this.readyStartGo.setFrame(1);
  136.     %this.schedule(1500, readySartGo2);
  137. }
  138.  
  139. function EnemyMcGeeManagerBehavior::readySartGo2(%this)
  140. {
  141.     %this.vs.setLayer(31);
  142.    
  143.     %this.readyStartGo.setFrame(2);
  144.     %this.schedule(1000, readySartGo3);
  145.    
  146.     $GameOn = true;
  147.     $noControl = false;
  148.    
  149.     %this.goToPickUp();
  150.     %this.timer();
  151.    
  152. }
  153. function EnemyMcGeeManagerBehavior::readySartGo3(%this)
  154. {
  155.     %this.readyStartGo.setFrame(0);
  156.     %this.readyStartGo.setLayer(31);
  157.    
  158.     $EnemyWalking = true;
  159.     $EnemyWalkingLeft = true;
  160. }
  161.  
  162. function EnemyMcGeeManagerBehavior::goToPickUp(%this)
  163. {
  164.     echo("GO TO PCIK UP!!!!!!!");
  165.     $EnemyMounted = false;
  166.     $EnemyWalkingLeft = true;
  167.     $EnemyWalking = true;
  168.     $EnemyChangeState =true;
  169.     $CreateNewEnemyChip = true;
  170.     $newEnemyChip = 0;
  171.    
  172.     $ChipChangeState = true;
  173.     $createNewChip = true;
  174.    
  175.     return;
  176. }
  177.  
  178.  
  179.  
  180. ///TIMER
  181. function EnemyMcGeeManagerBehavior::timer(%this)
  182. {
  183.     if($gameIsUp == true)
  184.     {
  185.         $timerValue = 0;
  186.         ///echo("timer is returned because game is up");
  187.         return;
  188.     }
  189.    
  190.     $timerValue = $timerValue + 1;
  191.     echo("$timerValue " @ $timerValue);
  192.     echo("...");
  193.     echo("..");
  194.     echo(".");
  195.    
  196.     $timerBarSize = $timerBar.size;
  197.    
  198.    
  199.     %newX = $timerBarSize.x - (0.75);
  200.     %newY = $timerBarSize.y;
  201.        
  202.     $timerBar.size = %newX SPC %newY;  
  203.        
  204.     if($timerValue >= 120)
  205.     {
  206.         $timesUp.setLayer(1);
  207.        
  208.        
  209.         ///delete any extra chips
  210.         for(%i = 0; %i < %this.owner.scenegraph.getCount(); %i++)
  211.         {
  212.             %currentObject = %this.owner.scenegraph.getObject(%i);
  213.            
  214.             if(%currentObject.group == 27)
  215.             {
  216.                 %currentObject.safeDelete();
  217.             }
  218.         }  
  219.         $timerValue = 0;
  220.        
  221.         %this.schedule(2000, callUpWinnerLoser);
  222.         return;
  223.     }
  224.    
  225.     ///%this.schedule(1000, timer);
  226. }
  227.  
  228.  
  229.  
  230.  
  231. ////WINNER LOSER TITLES AT END ROUND
  232. function EnemyMcGeeManagerBehavior::callUpWinnerLoser(%this)
  233. {  
  234.  
  235.     $noControl = true;
  236.     %ChipPos = $Chip.Position;
  237.     $ChipWinnerLoser.setPosition(%ChipPos.x + 20 SPC %ChipPos.y + 15);
  238.     %EnemyPos = $Enemy.position;
  239.     $EnemyWinnerLoser.setPosition(%EnemyPos.x + 20 SPC %EnemyPos.y + 30);
  240.     if($ChipScore > $EnemyScore)
  241.     {
  242.         $ChipWinnerLoser.setLayer(1);
  243.         $ChipWinnerLoser.setFrame(0);
  244.         $EnemyWinnerLoser.setLayer(1);
  245.         $EnemyWinnerLoser.setFrame(1);
  246.     }
  247.     else if($ChipScore < $EnemyScore)
  248.     {
  249.         $ChipWinnerLoser.setLayer(1);
  250.         $ChipWinnerLoser.setFrame(1);
  251.         $EnemyWinnerLoser.setLayer(1);
  252.         $EnemyWinnerLoser.setFrame(0);
  253.     }
  254.     else if($ChipScore == $EnemyScore)
  255.     {
  256.         $ChipWinnerLoser.setLayer(1);
  257.         $ChipWinnerLoser.setFrame(1);
  258.         $EnemyWinnerLoser.setLayer(1);
  259.         $EnemyWinnerLoser.setFrame(1);     
  260.        
  261.     }
  262.     echo("Should have set all winner loser images");
  263.     echo("%this.ChipWinnerLoser.position " @ %this.ChipWinnerLoser.position);
  264.     echo("%this.ChipWinnerLoser " @ %this.ChipWinnerLoser.position);
  265.     echo("kkkkkkkkkkkkkkkk");
  266.  
  267.     %this.schedule(3000, callWinTaskScreen);
  268.     return;
  269. }
  270.  
  271.  
  272.  
  273. function EnemyMcGeeManagerBehavior::createEnemy(%this) 
  274. {
  275.    
  276.     $createNewEnemy = false;
  277.    
  278.    
  279.     ///delete any extra chips
  280.     for(%i = 0; %i < %this.owner.scenegraph.getCount(); %i++)
  281.     {
  282.         %currentObject = %this.owner.scenegraph.getObject(%i);
  283.        
  284.         if(%currentObject.group == 4)
  285.         {
  286.             %currentObject.safeDelete();
  287.         }
  288.     }      
  289.    
  290.     $level_MrMan = true;
  291.    
  292.     if($level_McGee == true)
  293.     {
  294.         $Enemy =  new t2dAnimatedSprite(enemy) {
  295.             animationName = "McGeeStandAnimation";
  296.             scenegraph = %this.owner.scenegraph;    
  297.             mUseSourceRect = "0";
  298.             sourceRect = "0 0 0 0";
  299.             canSaveDynamicFields = "1";
  300.             UseMouseEvents = "1";
  301.             usesPhysics = "1";
  302.             size = "105.236 210.472";
  303.             position = "-65 -87.811";
  304.             Layer = "10";
  305.             class = "enemyClass";
  306.             CollisionActiveReceive = "1";
  307.             CollisionActiveSend = "1";
  308.             CollisionPhysicsReceive = "0";
  309.             CollisionPhysicsSend = "0";
  310.             CollisionCallback = "1";
  311.             CollisionMaxIterations = "3";
  312.             WorldLimitMode = "CLAMP";
  313.             WorldLimitMin = "-157.993 -1813.661";
  314.             WorldLimitMax = "141.314 1556.239";
  315.             WorldLimitCallback = "1";      
  316.             mountID = "2";
  317.             CollisionPolyList = "-0.260 -0.015  0.250   -0.005  0.285   0.270 -0.147 0.275";
  318.             _behavior0 = "EnemyBehavior";
  319.             group = 4;
  320.             }; 
  321.            
  322.         $EnemyVelocity = 45;
  323.     }
  324.    
  325.    
  326.     if($level_Dunn == true)
  327.     {      
  328.         $Enemy =  new t2dAnimatedSprite(enemy) {
  329.             animationName = "DunnStandAnimation";
  330.             scenegraph = %this.owner.scenegraph;    
  331.             mUseSourceRect = "0";
  332.             sourceRect = "0 0 0 0";
  333.             canSaveDynamicFields = "1";
  334.             UseMouseEvents = "1";
  335.             usesPhysics = "1";
  336.             size = "104.858 209.715";
  337.             position = "-65 -110.141";
  338.             Layer = "5";
  339.             class = "enemyClass";
  340.             CollisionActiveReceive = "1";
  341.             CollisionActiveSend = "1";
  342.             CollisionPhysicsReceive = "0";
  343.             CollisionPhysicsSend = "0";
  344.             CollisionCallback = "1";
  345.             CollisionMaxIterations = "3";
  346.             WorldLimitMode = "CLAMP";
  347.             WorldLimitMin = "-157.993 -1813.661";
  348.             WorldLimitMax = "141.314 1556.239";
  349.             WorldLimitCallback = "1";      
  350.             mountID = "2";
  351.             CollisionPolyList = "-0.260 -0.015  0.250   -0.005  0.403   0.599   -0.319  0.629";
  352.             _behavior0 = "EnemyBehavior";
  353.             group = 4;
  354.             }; 
  355.         $EnemyVelocity = 25;
  356.     }
  357.    
  358.     if($level_MrMan == true)
  359.     {
  360.         $Enemy =  new t2dAnimatedSprite(enemy) {
  361.             animationName = "MrManStandAnimation";
  362.             scenegraph = %this.owner.scenegraph;    
  363.             mUseSourceRect = "0";
  364.             sourceRect = "0 0 0 0";
  365.             canSaveDynamicFields = "1";
  366.             UseMouseEvents = "1";
  367.             usesPhysics = "1";
  368.             size = "182.477 182.477";
  369.             position = "-65 -116.141";
  370.             Layer = "5";
  371.             class = "enemyClass";
  372.             CollisionActiveReceive = "1";
  373.             CollisionActiveSend = "1";
  374.             CollisionPhysicsReceive = "0";
  375.             CollisionPhysicsSend = "0";
  376.             CollisionCallback = "1";
  377.             CollisionMaxIterations = "3";
  378.             WorldLimitMode = "CLAMP";
  379.             WorldLimitMin = "-157.993 -1813.661";
  380.             WorldLimitMax = "141.314 1556.239";
  381.             WorldLimitCallback = "1";      
  382.             mountID = "2";
  383.             CollisionPolyList = "-0.260 -0.015  0.250   -0.005  0.403   0.599   -0.319  0.629";
  384.             _behavior0 = "EnemyBehavior";
  385.             group = 4;
  386.             }; 
  387.         $EnemyVelocity = 25;   
  388.     }
  389.  
  390.    
  391.     ///\\\||
  392.     /////\\\|||
  393.     ///May be a useless variable
  394.     ///set Chips win count to 0
  395.     $s1L1ChipWinCount = 0;
  396.     $s1L1EnemyWinCount = 0;
  397.  }
  398.  
  399.  
  400.  
  401.  
  402. function EnemyMcGeeManagerBehavior::onUpdate(%this)
  403. {  
  404.    
  405.     if($beginTimer == true)
  406.     {
  407.         $beginTimer = false;
  408.         %this.timer();
  409.     }
  410.    
  411.     ///this tells the engine to create a new enemy and begin the match.
  412.     if($loadNewRound == true)
  413.     {
  414.         $loadNewRound = false;
  415.         %this.readyStartGo0();
  416.         %this.createEnemy();
  417.         return;
  418.     }
  419.  
  420.     if($EnemyChangeState == true)
  421.     {
  422.             ///echo("Enemy has changed State");
  423.             ///echo("E");
  424.        
  425.         $EnemyChangeState = false;
  426.        
  427.        
  428.         if($EnemyGoToPickUp == true)
  429.         {
  430.             ///echo("Enemy go to pick up");
  431.             ///echo("E");
  432.             $EnemyGoToPickUp = false;
  433.             %this.goToPickUp();
  434.             return;
  435.         }
  436.        
  437.         if($EnemyWalking == true)
  438.         {
  439.             ///echo("Enemy Walking");
  440.             ///echo("E");
  441.             $EnemyDefending = false;
  442.             $EnemyRobbed = false;
  443.            
  444.             ///playAnimation
  445.             %this.enemyWalking();
  446.            
  447.             if($EnemyWalkingLeft == true)
  448.             {
  449.                 echo("Enemy Walking Left");
  450.                 echo("E");
  451.                 $EnemyWalkingRight = false;
  452.                 ///animate walking left
  453.                 //set flip
  454.                 $Enemy.setFlipX(true);
  455.                 ///set velocity
  456.                 $Enemy.setLinearVelocityX($EnemyVelocity * (-1));
  457.                 return;
  458.             }
  459.             else if($EnemyWalkingRight == true)
  460.             {
  461.                 echo("Enemy Walking Right");
  462.                 echo("E");             
  463.                 $EnemyWalkingLeft = false;
  464.                 ///animate walking left
  465.                 //set flip
  466.                 $Enemy.setFlipX(false);
  467.                 ///set velocity
  468.                 $Enemy.setLinearVelocityX($EnemyVelocity);
  469.                 return;
  470.             }
  471.         }
  472.         else if($EnemyWalking == false)
  473.         {
  474.             ///echo("Enemy Walking is FALSE");
  475.             ///echo("E");  
  476.  
  477.             $Enemy.setLinearVelocityX(0);
  478.             %this.enemyWalking();
  479.            
  480.             if($EnemyOutOfChips == true)
  481.             {
  482.                 $EnemyChangeState = false;
  483.                 return;
  484.             }
  485.            
  486.             if($EnemyHit == true)
  487.             {
  488.                
  489.                 ///echo("enemy hit : : : : : : : ");
  490.                 ///echo(" enemy hit : : : : : : : ");
  491.                 ///echo("enemy hit : : : : : : : ");
  492.                 ///echo(" enemy hit : : : : : : : ");
  493.                 ///echo("enemy hit : : : : : : : ");
  494.    
  495.                
  496.                 return;
  497.             }
  498.             if($EnemyDefending == true)
  499.             {
  500.                
  501.                 ///echo("enemy defending $$$$$$$$$$$$");
  502.                 ///echo(" enemy defending $$$$$$$$$$$$");
  503.                 ///echo("enemy defending $$$$$$$$$$$$");       
  504.                
  505.                 return;
  506.             }
  507.             if($EnemySmacking == true)
  508.             {
  509.                 ///echo("enemy Smacking $$$$$$$$$$$$");
  510.                 ///echo(" enemy Smacking $$$$$$$$$$$$");
  511.                 ///echo("enemy Smacking $$$$$$$$$$$$");    
  512.                 return;
  513.             }
  514.        
  515.         }  
  516.     }
  517.    
  518.     if($createNewEnemy == true)
  519.     {
  520.         %this.createEnemy();
  521.     }
  522.    
  523.    
  524.    
  525.     if($createNewEnemyChip  == true)
  526.     {
  527.         if($newEnemyChipCreated == true)
  528.         {
  529.             return;
  530.         }
  531.        
  532.         $createNewEnemyChip  = false;
  533.        
  534.         if($EnemyOutOfChips == false)
  535.         {
  536.             $EnemyWalkingRight = false;
  537.             $EnemyWalkingLeft = false;
  538.             $EnemyWalking = false; 
  539.            
  540.             $newEnemyChip = $newEnemyChip + 1;
  541.             echo("newEnemyChip" @ $newEnemyChip);
  542.             echo("newEnemyChip");
  543.             echo("newEnemyChip");
  544.             echo("newEnemyChip");
  545.             echo("newEnemyChip");
  546.             if($newEnemyChip <= 5)
  547.             {
  548.                 $EnemyMounted = false;
  549.                 $EnemyWalkingRight = false;
  550.                 $EnemyWalkingLeft = true;
  551.                 $EnemyWalking = true;
  552.                 $EnemyDefending = false;
  553.                 $EnemyRobbed = false;
  554.                 $EnemyStopped = false;
  555.                
  556.                 if($town_DoLittle == true)
  557.                 {
  558.                     if($level_McGee == true)
  559.                     {
  560.                         %this.EnemyChip = new t2dStaticSprite(enemyChip)
  561.                         {
  562.                             scenegraph = %this.owner.scenegraph;
  563.                             imageMap = "chipsChipImageMap";
  564.                             frame = "0";
  565.                             mUseSourceRect = "0";
  566.                             sourceRect = "0 0 0 0";
  567.                             canSaveDynamicFields = "1";
  568.                             class = "enemyChipClass";
  569.                             layer = "10";
  570.                             Position = "-133.922 -74.527";
  571.                             size = "15.321 15.321";
  572.                             CollisionActiveSend = "1";
  573.                             CollisionActiveReceive = "1";
  574.                             CollisionPhysicsSend = "0";
  575.                             CollisionCallback = "1";
  576.                             CollisionCircleScale = "0.5";
  577.                             CollisionMaxIterations = "3";
  578.                             CollisionDetectionMode = "CIRCLE";
  579.                             CollisionResponseMode = "RIGID";
  580.                             BlendColor = "0.000000 0.815686 0.070588 1.000000";
  581.                             WorldLimitMode = "BOUNCE";
  582.                             WorldLimitMin = "-160.993 -1813.661";
  583.                             WorldLimitMax = "145.314 1556.239";
  584.                             WorldLimitCallback = "1";              
  585.                             Friction = "0.7";
  586.                             Damping = "1";
  587.                             MountOffset = "-0.252 -0.199";
  588.                             MountOwned = "0";
  589.                             MountInheritAttributes = "0";
  590.                             mountID = "41";
  591.                             mountToID = "40";
  592.                             _behavior0 = "McGeeChipBehavior";
  593.                             group = 27;
  594.                             };
  595.                     }
  596.                     if($level_Dunn == true)
  597.                     {
  598.                         %this.EnemyChip = new t2dStaticSprite(enemyChip)
  599.                         {
  600.                             scenegraph = %this.owner.scenegraph;
  601.                             imageMap = "chipsChipImageMap";
  602.                             frame = "0";
  603.                             mUseSourceRect = "0";
  604.                             sourceRect = "0 0 0 0";
  605.                             canSaveDynamicFields = "1";
  606.                             class = "enemyChipClass";
  607.                             layer = "10";
  608.                             Position = "-133.922 -74.527";
  609.                             size = "15.321 15.321";
  610.                             CollisionActiveSend = "1";
  611.                             CollisionActiveReceive = "1";
  612.                             CollisionPhysicsSend = "0";
  613.                             CollisionCallback = "1";
  614.                             CollisionCircleScale = "0.5";
  615.                             CollisionMaxIterations = "3";
  616.                             CollisionDetectionMode = "CIRCLE";
  617.                             CollisionResponseMode = "RIGID";
  618.                             BlendColor = "0.000000 0.815686 0.070588 1.000000";
  619.                             WorldLimitMode = "BOUNCE";
  620.                             WorldLimitMin = "-160.993 -1813.661";
  621.                             WorldLimitMax = "145.314 1556.239";
  622.                             WorldLimitCallback = "1";              
  623.                             Friction = "0.7";
  624.                             Damping = "1";
  625.                             MountOffset = "-0.252 -0.199";
  626.                             MountOwned = "0";
  627.                             MountInheritAttributes = "0";
  628.                             mountID = "41";
  629.                             mountToID = "40";
  630.                             _behavior0 = "DunnChipBehavior";
  631.                             group = 27;
  632.                             };
  633.                     }  
  634.                     if($level_MrMan == true)
  635.                     {
  636.                         %this.EnemyChip = new t2dStaticSprite(enemyChip)
  637.                         {
  638.                             scenegraph = %this.owner.scenegraph;
  639.                             imageMap = "chipsChipImageMap";
  640.                             frame = "0";
  641.                             mUseSourceRect = "0";
  642.                             sourceRect = "0 0 0 0";
  643.                             canSaveDynamicFields = "1";
  644.                             class = "enemyChipClass";
  645.                             layer = "10";
  646.                             Position = "-133.922 -74.527";
  647.                             size = "15.321 15.321";
  648.                             CollisionActiveSend = "1";
  649.                             CollisionActiveReceive = "1";
  650.                             CollisionPhysicsSend = "0";
  651.                             CollisionCallback = "1";
  652.                             CollisionCircleScale = "0.5";
  653.                             CollisionMaxIterations = "3";
  654.                             CollisionDetectionMode = "CIRCLE";
  655.                             CollisionResponseMode = "RIGID";
  656.                             BlendColor = "0.000000 0.815686 0.070588 1.000000";
  657.                             WorldLimitMode = "BOUNCE";
  658.                             WorldLimitMin = "-160.993 -1813.661";
  659.                             WorldLimitMax = "145.314 1556.239";
  660.                             WorldLimitCallback = "1";              
  661.                             Friction = "0.7";
  662.                             Damping = "1";
  663.                             MountOffset = "-0.252 -0.199";
  664.                             MountOwned = "0";
  665.                             MountInheritAttributes = "0";
  666.                             mountID = "41";
  667.                             mountToID = "40";
  668.                             _behavior0 = "MrManChipBehavior";
  669.                             group = 27;
  670.                             };
  671.                     }
  672.                 }                                  
  673.                
  674.                
  675.                 $newEnemyChipCreated = true;
  676.                
  677.                 %this.bringUpChipAnee();
  678.  
  679.                 return;
  680.                
  681.             }
  682.            
  683.             else if($newEnemyChip >= 6)
  684.             {
  685.                 $EnemyWalking = false;
  686.                 $EnemyWalkingLeft = false;
  687.                 $EnmeyWalkingRight = false;
  688.                 $EnemyChangeState = true;
  689.                 $EnemyOutOfChips = true;
  690.                 $EnemyCheckChipsPos = true;
  691.                 return;
  692.                
  693.             }
  694.         }
  695.     }
  696.  
  697.     if($EnemyCheckChipsPos == true)
  698.     {
  699.         $EnemyCheckChipsPos = false;
  700.         %this.schedule(1500, checkChipPos);
  701.         echo("$EnemyCheckChipsPos INSIDE OF FUNCTION" @ $EnemyCheckChipsPos);
  702.         return;
  703.     }
  704.    
  705.    
  706.     if($gameIsUp == false)
  707.     {                          
  708.         if($BirdInAction == true)
  709.         {
  710.             ///echo("bird is in action so return");
  711.             return;
  712.         }
  713.        
  714.         if($BirdInAction == false)
  715.         {
  716.  
  717.             $BirdInAction = true;
  718.            
  719.             ///create in here, schedules to cal random bird action
  720.             %randomBirdCreatedIn = getRandom(10000, 20000);
  721.             %this.schedule(%randomBirdCreatedIn, createBird);
  722.            
  723.             echo("%randomBirdCreatedIn" @ %randomBirdCreatedIn);
  724.            
  725.             return;
  726.         }
  727.     }
  728.  
  729.     return;
  730.  
  731. }  
  732.  
  733. function EnemyMcGeeManagerBehavior::checkChipPos(%this)
  734. {
  735.     echo("CHECKIN CHIPS POS");
  736.     echo("$EnemyCheckChipsPos" @ $EnemyCheckChipsPos);
  737.     %enemyPosX = $Enemy.position.x;
  738.     echo("%enemyPosX" @ %enemyPosX);
  739.     %ChipPosX = $Chip.position.x;
  740.        
  741.     if(%ChipPosX > %enemyPosX)
  742.     {
  743.         %this.enemy.setFlipX(false);
  744.     }
  745.     else if(%ChipPosX < %enemyPosX)
  746.     {
  747.         %this.enemy.setFlipX(true);
  748.     }
  749.        
  750.     $EnemyChangeState = true;
  751.     $EnemyCheckChipsPos = true;
  752.     echo("here call to repeat");
  753. }
  754.  
  755.  
  756. function EnemyMcGeeManagerBehavior::bringUpChipAnee(%this)
  757. {
  758.     if($newEnemyChipCreated == false)
  759.     {
  760.         return;
  761.     }
  762.  
  763.     $EnemyChipInAnee.setLayer(4);
  764.     $EnemyChipInAnee.playAnimation(chipInAneeAnimation);
  765.     %this.schedule(1200, bringUpChip);
  766.     return;
  767. }
  768.  
  769. function EnemyMcGeeManagerBehavior::bringUpChip(%this)
  770. {
  771.     %this.EnemyChip.setLayer(3);
  772.    
  773.     %this.EnemyChipInAnee.safeDelete();
  774.    
  775.    
  776.     if($EnemyMounted == false)
  777.     {
  778.         $EnemyWalking = true;
  779.         $EnemyWalkingLeft = true;
  780.     }
  781.    
  782.     $newEnemyChipCreated = false;
  783.    
  784.     return;
  785. }
  786.    
  787.  
  788.  
  789.  
  790.  
  791.  
  792. function EnemyMcGeeManagerBehavior::createBird(%this)
  793. {  
  794.         ///Bird
  795.         $Bird =  new t2dAnimatedSprite(Bird) {
  796.         scenegraph = %this.owner.scenegraph;    
  797.         animationName = "birdAnimation";
  798.         frame = "0";
  799.         mUseSourceRect = "0";
  800.         sourceRect = "0 0 0 0";
  801.         canSaveDynamicFields = "1";
  802.         UseMouseEvents = "1";
  803.         usesPhysics = "1";
  804.         size = "72.323 72.323";
  805.         position = "-350 -190.398";
  806.         Layer = "5";
  807.         Class = enemyClass;
  808.         CollisionActiveReceive = "1";
  809.         CollisionActiveSend = "1";
  810.         CollisionPhysicsReceive = "0";
  811.         CollisionPhysicsSend = "0";
  812.         CollisionCallback = "1";
  813.         CollisionMaxIterations = "3";
  814.         WorldLimitMode = "KILL";
  815.         WorldLimitMin = "-350.993 -1813.661";
  816.         WorldLimitMax = "350 1556.239";
  817.         WorldLimitCallback = "1";      
  818.         mountID = "2";
  819.         CollisionPolyList = "-0.462 -0.103 0.570 -0.265 0.506 0.246 -0.467 0.260";
  820.         _behavior0 = "birdBehavior";
  821.         group = 4;
  822.         };     
  823. }
  824.  
  825.  
  826. function EnemyMcGeeManagerBehavior::enemyWalking(%this)
  827. {  
  828.     if($EnemyWalking == true)
  829.     {
  830.         if($level_McGee == true)
  831.         $Enemy.playAnimation(McGeeWalkAnimation);
  832.        
  833.         if($level_Dunn == true)
  834.         $Enemy.playAnimation(DunnWalkAnimation);
  835.        
  836.         if($level_MrMan == true)
  837.         $Enemy.playAnimation(MrManWalkAnimation);
  838.     }
  839.     else if($EnemyWalking == false)
  840.     {
  841.         if($level_McGee == true)
  842.         $Enemy.playAnimation(McGeeStandAnimation);
  843.        
  844.         if($level_Dunn == true)
  845.         $Enemy.playAnimation(DunnStandAnimation);
  846.        
  847.         if($level_MrMan == true)
  848.         $Enemy.playAnimation(MrManStandAnimation);
  849.     }
  850. }
  851.  
  852.  
  853. ////Here, if time runs up. WinScreenTask is called and set as well as all running tallyes o scores.
  854. function EnemyMcGeeManagerBehavior::callWinTaskScreen(%this)
  855. {                              
  856.     echo("IN WIN SCREEN TASK");
  857.    
  858.     ///hide all strawberries
  859.     for(%i = 0; %i < %this.owner.scenegraph.getCount(); %i++)
  860.     {
  861.         %currentObject = %this.owner.scenegraph.getObject(%i);
  862.        
  863.         if(%currentObject.group == 23)
  864.         {
  865.             %currentObject.setLayer(31);
  866.         }
  867.         else if(%currentObject.group == 11)
  868.         {
  869.             ///delete any strawberries
  870.             %currentObject.safeDelete();
  871.         }
  872.     }      
  873.    
  874.     ///delete any extra chips
  875.     for(%i = 0; %i < %this.owner.scenegraph.getCount(); %i++)
  876.     {
  877.         %currentObject = %this.owner.scenegraph.getObject(%i);
  878.        
  879.         if(%currentObject.group == 27)
  880.         {
  881.             %currentObject.safeDelete();
  882.         }
  883.     }  
  884.    
  885.     $timesUp.layer = 31;
  886.    
  887.    
  888.     ///hide winner loser images
  889.     $ChipWinnerLoser.layer = 31;
  890.     echo("$ChipWinnerLoser.layer" @ $ChipWinnerLoser.layer);
  891.     $EnemyWinnerLoser.layer = 31;
  892.     echo("$EnemyWinnerLoser.layer" @ $ChipWinnerLoser.layer);
  893.    
  894.     //bring all items to layer seen
  895.     %this.winTaskScreen.setLayer(1);
  896.     %this.ChipWinCount.setLayer(0);
  897.     %this.EnemyWinCount.setLayer(0);
  898.     %this.ChipRoundWLT.setLayer(0);
  899.     %this.EnemyRoundWLT.setLayer(0);   
  900.     %this.ChipMoneyCount1s.setLayer(0);
  901.     %this.ChipMoneyCount10s.setLayer(0);
  902.     %this.ChipMoneyCount100s.setLayer(0);
  903.     %this.ChipMoneyCount1000s.setLayer(0);
  904.     %this.ChipTotalMoneyCount1s.setLayer(0);
  905.     %this.ChipTotalMoneyCount10s.setLayer(0);
  906.     %this.ChipTotalMoneyCount100s.setLayer(0);
  907.     %this.ChipTotalMoneyCount1000s.setLayer(0);    
  908.     %this.EnemyMoneyCount1s.setLayer(0);
  909.     %this.EnemyMoneyCount10s.setLayer(0);
  910.     %this.EnemyMoneyCount100s.setLayer(0);
  911.     %this.EnemyMoneyCount1000s.setLayer(0);
  912.     %this.EnemyTotalMoneyCount1s.setLayer(0);
  913.     %this.EnemyTotalMoneyCount10s.setLayer(0);
  914.     %this.EnemyTotalMoneyCount100s.setLayer(0);
  915.     %this.EnemyTotalMoneyCount1000s.setLayer(0);   
  916.     %this.ep1.setLayer(0);
  917.     %this.ep2.setLayer(0);
  918.     %this.ep3.setLayer(0);
  919.     %this.cp1.setLayer(0);
  920.     %this.cp2.setLayer(0);
  921.     %this.cp3.setLayer(0);
  922.     echo("all items have been set to layers in EMB Winscreentask");
  923.     echo("%this.winTaskScreen.setLayer(1);" @ %this.winTaskScreen.layer);
  924.    
  925.     $strawberry.setPosition("-400 400");
  926.    
  927.     %this.continueBtn.setPosition("83.260 164.187");
  928.    
  929.    
  930.    
  931.     ///here The round has ended
  932.     ///win screen was been called up
  933.     ///now calculate who won
  934.     ///and calculate the running/total score
  935.    
  936.     //Chip Wins match
  937.     if($ChipsScore > $EnemyScore)
  938.     {
  939.         $ChipWinCount = $ChipWinCount + 1;
  940.        
  941.         %this.ChipRoundWLT.setFrame(0);
  942.         %this.EnemyRoundWLT.setFrame(1);       
  943.        
  944.         ////calculate the running totals of Chips Rounds $
  945.         $ChipsScore = $ChipsScore + $ChipsScore;
  946.         echo("$ChipsScore" @ $ChipsScore);
  947.         echo("$ChipsScore" @ $ChipsScore);
  948.         echo("$ChipsScore" @ $ChipsScore);
  949.         echo("$ChipsScore" @ $ChipsScore);
  950.         echo("$ChipsScore" @ $ChipsScore);
  951.         echo("$ChipsScore" @ $ChipsScore);
  952.         echo("$ChipWinCount" @ $ChipWinCount);
  953.         echo("$EnemyScore" @ $EnemyScore);
  954.         echo("$EnemyScore" @ $EnemyScore);
  955.         echo("$EnemyScore" @ $EnemyScore);
  956.         echo("$EnemyScore" @ $EnemyScore);
  957.         echo("$EnemyScore" @ $EnemyScore);
  958.         echo("$EnemyWinCount" @ $EnemyWinCount);
  959.         ///...
  960.         if($ChipsScore < 100)
  961.         {
  962.             ///CSTfs1s
  963.             $CSTfs1s = getSubStr($ChipsScore, 1, 1);
  964.             ///$CSTfs10s
  965.             $CSTfs10s = getSubStr($ChipsScore, 0, 1);
  966.             ///$CSTfs100s
  967.             $CSTfs100s = 0;
  968.             ///$CSTfs1000s
  969.             $CSTfs1000s = 0;
  970.  
  971.         }
  972.         else if($ChipsScore >= 100 && $ChipsScore < 1000)
  973.         {  
  974.             ///$CSTfs1s
  975.             $CSTfs1s = getSubStr($ChipsScore, 2, 1);
  976.             ///$CSTfs10s
  977.             $CSTfs10s = getSubStr($ChipsScore, 1, 1);
  978.             ///$CSTfs100s
  979.             $CSTfs100s = getSubStr($ChipsScore, 0, 1);
  980.             ///$CSTfs1000s
  981.             $CSTfs1000s = 0;
  982.         }  
  983.        
  984.        
  985.         ///save Banking
  986.         $Bank = $Bank + $ChipsTotalScore;
  987.        
  988.         if($ChipWinCount == 4)
  989.         {
  990.             $ChipWinTaskComplete = true;
  991.             ///by setting the above to true, the continue btn will load the character strip
  992.             ///also... will set the win screen task to the appropirate frame/adjust for Prize animation.
  993.             ///... to be worked out at this point.
  994.         }
  995.         %this.schedule(300, setCRWL);
  996.  
  997.     }
  998.     else if($ChipsScore < $EnemyScore)
  999.     {
  1000.         $EnemyWinCount = $EnemyWinCount + 1;
  1001.  
  1002.         %this.ChipRoundWLT.setFrame(1);
  1003.         %this.EnemyRoundWLT.setFrame(0);       
  1004.        
  1005.         %this.schedule(300, setCRWL);
  1006.         echo("$ChipsScore" @ $ChipsScore);
  1007.         echo("$ChipsScore" @ $ChipsScore);
  1008.         echo("$ChipsScore" @ $ChipsScore);
  1009.         echo("$ChipsScore" @ $ChipsScore);
  1010.         echo("$ChipsScore" @ $ChipsScore);
  1011.         echo("$ChipsScore" @ $ChipsScore);
  1012.         echo("$ChipWinCount" @ $ChipWinCount);
  1013.         echo("$EnemyScore" @ $EnemyScore);
  1014.         echo("$EnemyScore" @ $EnemyScore);
  1015.         echo("$EnemyScore" @ $EnemyScore);
  1016.         echo("$EnemyScore" @ $EnemyScore);
  1017.         echo("$EnemyScore" @ $EnemyScore);
  1018.         echo("$EnemyWinCount" @ $EnemyWinCount);   
  1019.     }  
  1020.     else if($ChipsScore == $EnemyScore)
  1021.     {
  1022.         %this.ChipRoundWLT.setFrame(1);
  1023.         %this.EnemyRoundWLT.setFrame(1);
  1024.  
  1025.         %this.schedule(300, setCRWL);
  1026.         echo("$ChipsScore" @ $ChipsScore);
  1027.         echo("$ChipsScore" @ $ChipsScore);
  1028.         echo("$ChipsScore" @ $ChipsScore);
  1029.         echo("$ChipsScore" @ $ChipsScore);
  1030.         echo("$ChipsScore" @ $ChipsScore);
  1031.         echo("$ChipsScore" @ $ChipsScore);
  1032.         echo("$ChipWinCount" @ $ChipWinCount);
  1033.         echo("$EnemyScore" @ $EnemyScore);
  1034.         echo("$EnemyScore" @ $EnemyScore);
  1035.         echo("$EnemyScore" @ $EnemyScore);
  1036.         echo("$EnemyScore" @ $EnemyScore);
  1037.         echo("$EnemyScore" @ $EnemyScore);
  1038.         echo("$EnemyWinCount" @ $EnemyWinCount);   
  1039.     }
  1040.    
  1041.    
  1042.     /////set all object score number and there representqaitve frames to 0.
  1043.     %this.ChipMoneyCount1s.setFrame(0);
  1044.     %this.ChipMoneyCount10s.setFrame(0);
  1045.     %this.ChipMoneyCount100s.setFrame(0);
  1046.    
  1047.    
  1048.    
  1049.     ///set timer to 0;
  1050.     $timerValue = 0;
  1051.     $gameIsUp = true;
  1052.     $beginTimer = false;   
  1053.    
  1054. }
  1055.  
  1056. function EnemyMcGeeManagerBehavior::setCRWL(%this)
  1057. {
  1058.  
  1059.     %this.ChipWinCount.setFrame($ChipWinCount);
  1060.     %this.EnemyWinCount.setFrame($EnemyWinCount);
  1061.    
  1062.     ///call schedules to set end round $ numbers :: tally style.
  1063.  
  1064.     %this.schedule(500,setCRT1);
  1065.     %this.schedule(650, setCRT10);
  1066.     %this.schedule(800, setCRT100);
  1067.     ///for Enemy
  1068.     %this.schedule(500,setECRT1);
  1069.     %this.schedule(650, setECRT10);
  1070.     %this.schedule(800, setECRT100);   
  1071.  
  1072.     ///call to return is tied. no need to talley total running score.
  1073.     if($ChipsScore <= $EnemyScore)
  1074.     {
  1075.         return;
  1076.     }
  1077.    
  1078.     ///call to do Chips Round Total Talley
  1079.     %this.schedule(300, setCRTT1);
  1080.     %this.schedule(450, setCRTT10);
  1081.     %this.schedule(600, setCRTT100);           
  1082.     return;
  1083.    
  1084. }  
  1085.    
  1086. function EnemyMcGeeManagerBehavior::setCRT1(%this)
  1087. {
  1088.     ///frame to be set
  1089.     %this.CRT1Frame = %this.CRT1Frame + 1;
  1090.     %this.ChipMoneyCount1s.setFrame(%this.CRT1Frame);
  1091.  
  1092.    
  1093.     if(%this.CRT1Frame == $fs1s)
  1094.     {
  1095.         %this.setCRT10now = true;
  1096.         return;
  1097.     }
  1098.    
  1099.     else if(%this.CRT1Frame != $fs1s)
  1100.     {
  1101.        
  1102.         if($fs1s == 0)
  1103.         {
  1104.             %this.ChipMoneyCount1s.setFrame(0);
  1105.             %this.setCRT10now = true;
  1106.             %this.CRT1Frame = 0;
  1107.             return;    
  1108.         }
  1109.         if(%this.CRT1Frame >= 10)
  1110.         {
  1111.             %this.CRT1Frame = 0;
  1112.             %this.schedule(150, setCRT1);
  1113.             return;
  1114.         }
  1115.         if(%this.CRT1Frame < 10)
  1116.         {
  1117.             %this.schedule(150, setCRT1);
  1118.             return;
  1119.         }      
  1120.  
  1121.     }
  1122. }
  1123.  
  1124. function EnemyMcGeeManagerBehavior::setCRT10(%this)
  1125. {
  1126.     if(%loaded == true)
  1127.     {
  1128.         return;
  1129.     }  
  1130.    
  1131.     ///frame to be set
  1132.     %this.CRT10Frame = %this.CRT10Frame + 1;
  1133.     %this.ChipMoneyCount10s.setFrame(%this.CRT10Frame);
  1134.    
  1135.     if(%this.setCRT10now != true)
  1136.     {
  1137.         if(%this.CRT10Frame >= 10)
  1138.         {
  1139.             %this.CRT10Frame = 0;
  1140.             ///echo("%this.setCRT10Frame >= 10 " @ %this.setCRT10Frame);
  1141.             %this.schedule(150, setCRT10);
  1142.             return;
  1143.         }
  1144.         else if(%this.CRT10Frame < 10)
  1145.         {
  1146.             %this.schedule(150, setCRT10);
  1147.             return;
  1148.         }
  1149.  
  1150.     }
  1151.     else if(%this.setCRT10now == true)
  1152.     {
  1153.         if(%this.CRT10Frame != $fs10s)
  1154.         {  
  1155.             if($fs10s == 0)
  1156.             {
  1157.                
  1158.                 %this.ChipMoneyCount10s.setFrame($fs10s);
  1159.                 %this.setCRT100now = true;
  1160.                 %this.setCRT10now = false;
  1161.                 %this.CRT10Frame = 0;      
  1162.                 return;    
  1163.             }  
  1164.             if(%this.CRT10Frame >= 10)
  1165.             {
  1166.                 %this.CRT10Frame = 0;
  1167.                 %this.schedule(150, setCRT10);
  1168.                 return;
  1169.             }
  1170.             else if(%this.CRT10Frame < 10)
  1171.             {
  1172.                 %this.schedule(150, setCRT10);
  1173.                 return;
  1174.             }  
  1175.         }
  1176.         else if(%this.CRT10Frame == $fs10s)
  1177.         {
  1178.            
  1179.             %this.ChipMoneyCount10s.setFrame($fs10s);
  1180.             %this.setCRT100now = true;
  1181.             %this.setCRT10now = false;
  1182.             %this.CRT10Frame = 0;
  1183.            
  1184.         }
  1185.     }
  1186. }
  1187.  
  1188. function EnemyMcGeeManagerBehavior::setCRT100(%this)
  1189. {
  1190.     if(%loaded == true)
  1191.     {
  1192.         return;
  1193.     }
  1194.    
  1195.     ///frame to be set
  1196.     %this.CRT100Frame = %this.CRT100Frame + 1;
  1197.     %this.ChipMoneyCount100s.setFrame(%this.CRT100Frame);
  1198.    
  1199.    
  1200.     if(%this.setCRT100now != true)
  1201.     {
  1202.         if(%this.CRT100Frame >= 10)
  1203.         {
  1204.             %this.CRT100Frame = 0;
  1205.             ///echo("%this.setCRT100Frame >= 10 " @ %this.setCRT100Frame);
  1206.             %this.schedule(150, setCRT100);
  1207.             return;
  1208.         }
  1209.         else if(%this.CRT100Frame < 10)
  1210.         {
  1211.             %this.schedule(150, setCRT100);
  1212.             return;
  1213.         }
  1214.  
  1215.     }
  1216.    
  1217.     else if(%this.setCRT100now == true)
  1218.     {
  1219.         ///echo("$fs100s" @ $fs100s);
  1220.         ///echo("%this.CRT100Frame" @ %this.CRT100Frame);      
  1221.         ///echo("%this.setCRT100now is true " @ %this.setCRT100now);
  1222.         if(%this.CRT100Frame != $fs100s)
  1223.         {
  1224.             if($fs100s == 0)
  1225.             {
  1226.                 %this.ChipMoneyCount100s.setFrame($fs100s);
  1227.                 %this.setCRTT1now = true;
  1228.                 %this.setCRT100now = false;
  1229.                 %this.CRT1Frame = 0;
  1230.                 return;
  1231.             }              
  1232.             if(%this.CRT100Frame >= 10)
  1233.             {
  1234.                 %this.CRT100Frame = 0;
  1235.                 ///echo("%this.setCRT100Frame >= 10 " @ %this.setCRT100Frame);
  1236.                 %this.schedule(150, setCRT100);
  1237.                 return;
  1238.             }
  1239.             else if(%this.CRT100Frame < 10)
  1240.             {
  1241.                 %this.schedule(150, setCRT100);
  1242.                 return;
  1243.             }  
  1244.         }
  1245.         else if(%this.CRT100Frame == $fs100s)
  1246.         {
  1247.             %this.ChipMoneyCount100s.setFrame($fs100s);
  1248.             %this.setCRTT1now = true;
  1249.             %this.setCRT100now = false;
  1250.             %this.CRT100Frame = 0;     
  1251.         }
  1252.     }
  1253. }
  1254.  
  1255.  
  1256. ///this set of functions calculate round totals.    
  1257. function EnemyMcGeeManagerBehavior::setCRTT1(%this)
  1258. {
  1259.     if(%loaded == true)
  1260.     {
  1261.         return;
  1262.     }
  1263.    
  1264.     ///frame to be set
  1265.     %this.CRTT1Frame = %this.CRTT1Frame + 1;
  1266.     %this.ChipTotalMoneyCount1s.setFrame(%this.CRTT1Frame);
  1267.    
  1268.     if(%this.setCRTT1now != true)
  1269.     {
  1270.         if(%this.CRTT1Frame >= 10)
  1271.         {
  1272.             %this.CRTT1Frame = 0;
  1273.             %this.schedule(150, setCRTT1);
  1274.             return;
  1275.         }
  1276.         else if(%this.CRTT1Frame < 10)
  1277.         {
  1278.             %this.schedule(150, setCRTT1);
  1279.             return;
  1280.         }
  1281.  
  1282.     }
  1283.    
  1284.     else if(%this.setCRTT1now == true)
  1285.     {
  1286.         if(%this.CRTT1Frame != $CSTfs1s)
  1287.         {
  1288.            
  1289.             if($CSTfs1s == 0)
  1290.             {
  1291.                 %this.ChipTotalMoneyCount1s.setFrame($CSTfs1s);
  1292.                 %this.setCRTT10now = true;
  1293.                 %this.setCRTT1now = false;
  1294.                 %this.CRTT1Frame = 0;
  1295.                 return;            
  1296.             }  
  1297.             if(%this.CRTT1Frame >= 10)
  1298.             {
  1299.                 %this.CRTT1Frame = 0;
  1300.                 %this.schedule(150, setCRTT1);
  1301.                 return;
  1302.             }
  1303.             else if(%this.CRTT1Frame < 10)
  1304.             {
  1305.                 %this.schedule(150, setCRTT1);
  1306.                 return;
  1307.             }  
  1308.         }
  1309.         else if(%this.CRTT1Frame == $CSTfs1s)
  1310.         {
  1311.             %this.ChipTotalMoneyCount1s.setFrame($CSTfs1s);
  1312.             %this.setCRTT10now = true;
  1313.             %this.setCRTT1now = false;
  1314.             %this.CRTT1Frame = 0;
  1315.             return;
  1316.         }
  1317.     }
  1318.  
  1319. }
  1320.  
  1321. function EnemyMcGeeManagerBehavior::setCRTT10(%this)
  1322. {
  1323.     if(%loaded == true)
  1324.     {
  1325.         return;
  1326.     }  
  1327.    
  1328.     ///frame to be set
  1329.     ///this variable, set to 0 at begining is a count
  1330.     %this.CRTT10Frame = %this.CRTT10Frame + 1;
  1331.     ///each count ups the frame of object
  1332.     %this.ChipTotalMoneyCount10s.setFrame(%this.CRTT10Frame);
  1333.    
  1334.     if(%this.setCRTT10now != true)
  1335.     {
  1336.         ///if this variuable is not true, as here
  1337.         ///... the count keeps cycling
  1338.         ///... creating the talley effect
  1339.         if(%this.CRTT10Frame >= 10)
  1340.         {
  1341.             ///if this variable is > 10
  1342.             ///... reset it to 0. to create cycle effect.
  1343.             ////call scedule to repeat cycle
  1344.             %this.CRTT10Frame = 0;
  1345.             %this.schedule(150, setCRTT10);
  1346.             return;
  1347.         }
  1348.         else if(%this.CRTT10Frame < 10)
  1349.         {
  1350.             ///...if variable is < 10
  1351.             ///no need to reset. keep going until it reaches 10
  1352.             //the reset
  1353.             %this.schedule(150, setCRTT10);
  1354.             return;
  1355.         }
  1356.  
  1357.     }
  1358.    
  1359.     else if(%this.setCRTT10now == true)
  1360.     {
  1361.         if(%this.CRTT10Frame != $CSTfs10s)
  1362.         {
  1363.            
  1364.             if($CSTfs10s == 0)
  1365.             {
  1366.                 %this.ChipTotalMoneyCount10s.setFrame($CSTfs10s);
  1367.                 %this.setCRTT100now = true;
  1368.                 %this.setCRTT10now = false;
  1369.                 %this.CRTT10Frame = 0;     
  1370.                 return;    
  1371.             }  
  1372.             if(%this.CRTT10Frame >= 10)
  1373.             {
  1374.                 %this.CRTT10Frame = 0;
  1375.                 %this.schedule(150, setCRTT10);
  1376.                 return;
  1377.             }
  1378.             else if(%this.CRTT10Frame < 10)
  1379.             {
  1380.                 %this.schedule(150, setCRTT10);
  1381.                 return;
  1382.             }  
  1383.         }
  1384.         else if(%this.CRTT10Frame == $CSTfs10s)
  1385.         {
  1386.             %this.ChipTotalMoneyCount10s.setFrame($CSTfs10s);
  1387.             %this.setCRTT100now = true;
  1388.             %this.setCRTT10now = false;
  1389.             %this.CRTT10Frame = 0;
  1390.            
  1391.         }
  1392.     }
  1393. }
  1394.  
  1395.  
  1396. function EnemyMcGeeManagerBehavior::setCRTT100(%this)
  1397. {
  1398.     if(%loaded == true)
  1399.     {
  1400.         return;
  1401.     }  
  1402.    
  1403.     ///frame to be set
  1404.     ///this variable, set to 0 at begining is a count
  1405.     %this.CRTT100Frame = %this.CRTT100Frame + 1;
  1406.     ///each count ups the frame of object
  1407.     %this.ChipTotalMoneyCount100s.setFrame(%this.CRTT100Frame);
  1408.    
  1409.     if(%this.setCRTT100now != true)
  1410.     {
  1411.  
  1412.         ///if this variuable is not true, as here
  1413.         ///... the count keeps cycling
  1414.         ///... creating the talley effect
  1415.         if(%this.CRTT100Frame >= 10)
  1416.         {
  1417.             ///if this variable is > 10
  1418.             ///... reset it to 0. to create cycle effect.
  1419.             ////call scedule to repeat cycle
  1420.             %this.CRTT100Frame = 0;
  1421.             ///echo("%this.setCRTT100Frame >= 10 " @ %this.setCRTT100Frame);
  1422.             %this.schedule(150, setCRTT100);
  1423.             return;
  1424.         }
  1425.         else if(%this.CRTT100Frame < 10)
  1426.         {
  1427.             ///...if variable is < 10
  1428.             ///no need to reset. keep going until it reaches 10
  1429.             //the reset
  1430.             %this.schedule(150, setCRTT100);
  1431.             ///echo("%this.CRTT100Frame" @ %this.CRTT100Frame);
  1432.             ///echo("%this.ChipTotalMoneyCount100s.frame " @ %this.ChipTotalMoneyCount100s.frame);
  1433.             ///echo("Here we are. This should call the CRRTT100 function again ");
  1434.             return;
  1435.         }
  1436.  
  1437.     }
  1438.    
  1439.     else if(%this.setCRTT100now == true)
  1440.     {
  1441.         ///here...
  1442.         ///the condition is true, that the object can now reveal its true worth
  1443.         ///freezing on its appropriate number
  1444.        
  1445.         if(%this.CRTT100Frame != $CSTfs100s)
  1446.         {
  1447.             ///if variable does not equal the real amount of object
  1448.             if(%loaded == true)
  1449.             {
  1450.                 ///guide to prevent double loads/miscalculations. A lock if you will that is set
  1451.                 ///... when real value met.
  1452.                 return;
  1453.             }
  1454.             if($CSTfs100s == 0)
  1455.             {
  1456.                 ///real value does == 0.
  1457.                 ///set value as such,
  1458.                 %this.ChipTotalMoneyCount100s.setFrame($CSTfs100s);
  1459.                 %this.setCRTT100now = false;
  1460.                 %this.CRTT100Frame = 0;
  1461.                 return;    
  1462.             }          
  1463.             else if(%this.CRTT100Frame >= 10)
  1464.             {
  1465.                 %this.CRTT100Frame = 0;
  1466.                 %this.schedule(150, setCRTT100);
  1467.                 return;
  1468.             }
  1469.             else if(%this.CRTT100Frame < 10)
  1470.             {
  1471.                 %this.schedule(150, setCRTT100);
  1472.                 return;
  1473.             }          
  1474.  
  1475.  
  1476.         }
  1477.         else if(%this.CRTT100Frame == $CSTfs100s)
  1478.         {
  1479.             ////variable has looped into equivalence of real value
  1480.             ///...so...
  1481.             ///set condition for next function lock to be true (can caalculte next function
  1482.             ///call schedule for the next function
  1483.             ///set lock on this calculation
  1484.             %this.ChipTotalMoneyCount100s.setFrame($CSTfs100s);
  1485.             %this.setCRTT100now = false;
  1486.             %this.CRTT100Frame = 0;
  1487.             return;
  1488.         }
  1489.     }
  1490. }
  1491.  
  1492.    
  1493. function EnemyMcGeeManagerBehavior::setECRT1(%this)
  1494. {
  1495.     ///frame to be set
  1496.     %this.ECRT1Frame = %this.ECRT1Frame + 1;
  1497.     %this.EnemyMoneyCount1s.setFrame(%this.ECRT1Frame);
  1498.     echo("KJKJKJKJKJJKJKJKJKJ");
  1499.     echo("KJKJKJKJKJJKJKJKJ");
  1500.     echo("KJKJKJKJKJJKJKJK");
  1501.     echo("KJKJKJKJKJJKJ");
  1502.     echo("KJKJKJK");
  1503.     echo("$efs1s" @ $efs1s);
  1504.     echo("%this.ECRT1Frame" @ %this.ECRT1Frame);
  1505.     echo("$EnemyScore" @ $EnemyScore);
  1506.    
  1507.     if(%this.ECRT1Frame == $efs1s)
  1508.     {
  1509.         %this.setECRT10now = true;
  1510.         echo("unit one is set, set the call for next digit");
  1511.         return;
  1512.     }
  1513.    
  1514.     else if(%this.ECRT1Frame != $efs1s)
  1515.     {
  1516.         echo("%this.ECRT1Frame != $efs1s");
  1517.        
  1518.         if($efs1s == 0)
  1519.         {
  1520.             echo("$efs1s >= 10");
  1521.             %this.EnemyMoneyCount1s.setFrame(0);
  1522.             %this.setECRT10now = true;
  1523.             %this.ECRT1Frame = 0;
  1524.             return;    
  1525.         }
  1526.         if(%this.ECRT1Frame >= 10)
  1527.         {
  1528.             echo("$efs1s >= 10");
  1529.             %this.ECRT1Frame = 0;
  1530.             echo("%this.ECRT1Frame " @ %this.ECRT1Frame);
  1531.             %this.schedule(150, setECRT1);
  1532.             return;
  1533.         }
  1534.         if(%this.ECRT1Frame < 10)
  1535.         {
  1536.             echo("$efs1s <= 10");
  1537.             %this.schedule(150, setECRT1);
  1538.             return;
  1539.         }      
  1540.  
  1541.     }
  1542. }
  1543.  
  1544. function EnemyMcGeeManagerBehavior::setECRT10(%this)
  1545. {
  1546.     echo("$efs10s" @ $efs10s);
  1547.     echo("%this.ECRT10Frame" @ %this.ECRT10Frame);
  1548.     echo("$EnemyScore" @ $EnemyScore); 
  1549.    
  1550.     if(%loaded == true)
  1551.     {
  1552.         return;
  1553.     }  
  1554.    
  1555.     ///frame to be set
  1556.     %this.ECRT10Frame = %this.ECRT10Frame + 1;
  1557.     %this.EnemyMoneyCount10s.setFrame(%this.ECRT10Frame);
  1558.    
  1559.     if(%this.setECRT10now != true)
  1560.     {
  1561.         echo("%this.setECRT10now != true");
  1562.         if(%this.ECRT10Frame >= 10)
  1563.         {
  1564.             %this.ECRT10Frame = 0;
  1565.             ///echo("%this.setECRT10Frame >= 10 " @ %this.setECRT10Frame);
  1566.             %this.schedule(150, setECRT10);
  1567.             return;
  1568.         }
  1569.         else if(%this.ECRT10Frame < 10)
  1570.         {
  1571.             %this.schedule(150, setECRT10);
  1572.             return;
  1573.         }
  1574.  
  1575.     }
  1576.     else if(%this.setECRT10now == true)
  1577.     {
  1578.         echo("%this.setECRT10now == true");
  1579.         if(%this.ECRT10Frame != $efs10s)
  1580.         {  
  1581.             if($efs10s == 0)
  1582.             {
  1583.                
  1584.                 %this.EnemyMoneyCount10s.setFrame($efs10s);
  1585.                 %this.setECRT100now = true;
  1586.                 %this.setECRT10now = false;
  1587.                 %this.ECRT10Frame = 0;     
  1588.                 return;    
  1589.             }  
  1590.             if(%this.ECRT10Frame >= 10)
  1591.             {
  1592.                 %this.ECRT10Frame = 0;
  1593.                 %this.schedule(150, setECRT10);
  1594.                 return;
  1595.             }
  1596.             else if(%this.ECRT10Frame < 10)
  1597.             {
  1598.                 %this.schedule(150, setECRT10);
  1599.                 return;
  1600.             }  
  1601.         }
  1602.         else if(%this.ECRT10Frame == $efs10s)
  1603.         {
  1604.            
  1605.             %this.EnemyMoneyCount10s.setFrame($efs10s);
  1606.             %this.setECRT100now = true;
  1607.             %this.setECRT10now = false;
  1608.             %this.ECRT10Frame = 0;
  1609.            
  1610.         }
  1611.     }
  1612. }
  1613.  
  1614. function EnemyMcGeeManagerBehavior::setECRT100(%this)
  1615. {
  1616.     echo("$efs100s" @ $efs100s);
  1617.     echo("%this.ECRT100Frame" @ %this.ECRT100Frame);
  1618.     echo("$EnemyScore" @ $EnemyScore); 
  1619.     if(%loaded == true)
  1620.     {
  1621.         return;
  1622.     }
  1623.    
  1624.     ///frame to be set
  1625.     %this.ECRT100Frame = %this.ECRT100Frame + 1;
  1626.     %this.EnemyMoneyCount100s.setFrame(%this.ECRT100Frame);
  1627.    
  1628.    
  1629.     if(%this.setECRT100now != true)
  1630.     {
  1631.         if(%this.ECRT100Frame >= 10)
  1632.         {
  1633.             %this.ECRT100Frame = 0;
  1634.             ///echo("%this.setECRT100Frame >= 10 " @ %this.setECRT100Frame);
  1635.             %this.schedule(150, setECRT100);
  1636.             return;
  1637.         }
  1638.         else if(%this.ECRT100Frame < 10)
  1639.         {
  1640.             %this.schedule(150, setECRT100);
  1641.             return;
  1642.         }
  1643.  
  1644.     }
  1645.    
  1646.     else if(%this.setECRT100now == true)
  1647.     {
  1648.         ///echo("$efs100s" @ $efs100s);
  1649.         ///echo("%this.ECRT100Frame" @ %this.ECRT100Frame);    
  1650.         ///echo("%this.setECRT100now is true " @ %this.setECRT100now);
  1651.         if(%this.ECRT100Frame != $efs100s)
  1652.         {
  1653.             if($efs100s == 0)
  1654.             {
  1655.                 %this.EnemyMoneyCount100s.setFrame($efs100s);
  1656.                 %this.setECRT10now = true;
  1657.                 %this.setECRT1now = false;
  1658.                 %this.ECRT1Frame = 0;
  1659.                 return;
  1660.             }              
  1661.             if(%this.ECRT100Frame >= 10)
  1662.             {
  1663.                 %this.ECRT100Frame = 0;
  1664.                 ///echo("%this.setECRT100Frame >= 10 " @ %this.setECRT100Frame);
  1665.                 %this.schedule(150, setECRT100);
  1666.                 return;
  1667.             }
  1668.             else if(%this.ECRT100Frame < 10)
  1669.             {
  1670.                 %this.schedule(150, setECRT100);
  1671.                 return;
  1672.             }  
  1673.         }
  1674.         else if(%this.ECRT100Frame == $efs100s)
  1675.         {
  1676.             %this.EnemyMoneyCount100s.setFrame($efs100s);
  1677.             %this.setECRTT1now = true;
  1678.             %this.setECRT100now = false;
  1679.             %this.ECRT100Frame = 0;
  1680.             echo("CRT100 == $efs100s therefore return");
  1681.            
  1682.         }
  1683.     }
  1684. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement