Example #1
0
        //----------------------------------------------------------------------------------------------


        public void beginFire(Entity e, TimedShooterComponent shooterComp, TimerComponent timeComp, DirectionalComponent dir)
        {
            fireItem(e, dir);
            shooterComp.currentBurstNum++;
            if (shooterComp.currentBurstNum < shooterComp.numShotsPerBurst)
            {
                timeComp.addTimer(shooterComp.fireTimerString, shooterComp.timeBetweenShotsInBurst);
            }
            else
            {
                shooterComp.currentBurstNum = 0;
                timeComp.addTimer(shooterComp.fireTimerString, shooterComp.timeBetweenBursts);
                DrawComponent drawComp = ( DrawComponent )e.getComponent(GlobalVars.DRAW_COMPONENT_NAME);
                drawComp.resetAnimation();
            }
        }