Example #1
0
        private void AddEnemyHelo(
                ref Random rnd,
                ref Texture2D EnemyTexture,
                ref Texture2D EnemyTexture2,
                ref List<EnemyHelo> ChopperList
            )
        {
            //LeftOrRigth = lastHeloDirection;
            int LeftOrRigth = rnd.Next(2);

            if (LeftOrRigth == 0)
            {

                int yPos = 10;
                Animation enemyAnim = new Animation();
                enemyAnim.Initialize(EnemyTexture, new Vector2(0, yPos), EnemyTexture.Width / 2, EnemyTexture.Height, 2, 80, Color.White, true);

                EnemyHelo Helo = new EnemyHelo();
                Helo.Initialize(enemyAnim, yPos, false);
                ChopperList.Add(Helo);
            }
            else
            {
                int yPos = 50;
                Animation enemyAnim = new Animation();
                enemyAnim.Initialize(EnemyTexture2, new Vector2(0, yPos), EnemyTexture.Width / 2, EnemyTexture.Height, 2, 80, Color.White, true);

                EnemyHelo Helo = new EnemyHelo();
                Helo.Initialize(enemyAnim, yPos, true);
                ChopperList.Add(Helo);
            }
        }
Example #2
0
        //Side true= venstre mot høyre||Side false= høyre mot venstre
        public void Initialize(Animation HeloGraph, float Ypos, bool Side)
        {
            score = 100;
            Active = true;
            AddEnemyParatrooper = false;
            this.HeloGraph = HeloGraph;
            this.Side = Side;
            position.X = -40;
            position.Y=Ypos;
            rand = new Random();
            if (rand.Next(2) == 1)
            {
                WhenToDropTrooper = rand.Next(235) + 50; //For å komme til venstre for hvor det blir lagd trapp
            }
            else
            {
                WhenToDropTrooper = rand.Next(262) + 480;//For å komme til høyre
            }
            //WhenToDropTrooper = 281;
            //System.Console.WriteLine("Drop: "+WhenToDropTrooper);

            DropTrooper = true;
            speed = 4;//4
            if (!Side)
            {
                speed *= -1;
                position.X = 800;
            }

            //TrooperCoolDown = TimeSpan.FromSeconds(0.1f);
        }
 public void Initialize(Animation TrooperAnimation, Texture2D ParaTexture,Vector2 Pos)
 {
     Trooperscore = 10;
     chuteScore = 20;
     gotParachute = true;
     TrooperTexture = TrooperAnimation;
     TrooperTexture.Position.X += 7;
     TrooperTexture.Position.Y += 16;
     Position=Pos;
     Walkspeed = 0.5f;
     fallspeed = 1.5f;
     Chutexthure = ParaTexture;
     Active = true;
     parastate = ParaState.Chuted;
     Chute = new Parachute();
     Chute.initialize(ParaTexture, Pos);
 }
Example #4
0
 private void AddEnemyParatrooper(
         Vector2 Position,
         ref Texture2D ParatrooperTexture,
         ref Texture2D ParachuteTexture,
         ref List<EnemyParatrooper> ParatrooperList
     )
 {
     EnemyParatrooper para = new EnemyParatrooper();
         Animation TrooperAnim = new Animation();
         TrooperAnim.Initialize(ParatrooperTexture, Position, ParatrooperTexture.Width / 2, ParatrooperTexture.Height, 2, 80, Color.White, true);
         para.Initialize(TrooperAnim, ParachuteTexture, Position);
         ParatrooperList.Add(para);
 }