Example #1
0
        public override void Targeting(Vector2 OFFSET, Player ENEMY)
        {
            if (Globals.mouse.LeftClickRelease())
            {
                targetEffect.done = true;

                GameGlobals.PassProjectile(new FlameWaveProjectile(Globals.mouse.newMousePos - OFFSET, owner, new Vector2(0, 0), 1500));

                done   = true;
                active = false;
            }
            else
            {
                targetEffect.pos = Globals.mouse.newMousePos - OFFSET;
            }
        }
Example #2
0
        public override void AI(Player ENEMY, SquareGrid GIRD)
        {
            if (ENEMY.hero != null && (Globals.GetDistance(pos, ENEMY.hero.pos) < attackRange * .9f || isAttacking))
            {
                isAttacking = true;
                attackTimer.UpdateTimer();

                if (attackTimer.Test())
                {
                    GameGlobals.PassProjectile(new AcidSplash(new Vector2(pos.X, pos.Y), this, new Vector2(ENEMY.hero.pos.X, ENEMY.hero.pos.Y)));


                    attackTimer.ResetToZero();
                    isAttacking = false;
                }
            }
            else
            {
                base.AI(ENEMY, GIRD);
            }
        }
Example #3
0
        public override void Update(Vector2 OFFSET, Player ENEMY, SquareGrid GRID)
        {
            bool checkScoll = false;

            if (Globals.keyboard.GetPress("A") && pos.X > -50)
            {
                pos        = new Vector2(pos.X - speed, pos.Y);
                checkScoll = true;
            }

            if (Globals.keyboard.GetPress("D") && pos.X < 1250)
            {
                pos        = new Vector2(pos.X + speed, pos.Y);
                checkScoll = true;
            }

            if (Globals.keyboard.GetPress("W") && pos.Y > -50)
            {
                pos        = new Vector2(pos.X, pos.Y - speed);
                checkScoll = true;
            }

            if (Globals.keyboard.GetPress("S") && pos.Y < 750)
            {
                pos        = new Vector2(pos.X, pos.Y + speed);
                checkScoll = true;
            }
            if (Globals.keyboard.GetSinglePress("D1"))
            {
                currentSkill        = skills[0];
                currentSkill.Active = true;
            }

            if (Globals.keyboard.GetSinglePress("D2"))
            {
                currentSkill        = skills[1];
                currentSkill.Active = true;
            }

            GameGlobals.CheckScroll(pos);

            if (checkScoll)
            {
                SetAnimationByName("Walk");
            }
            else
            {
                SetAnimationByName("Stand");
            }


            rot = Globals.RotateTowards(pos, new Vector2(Globals.mouse.newMousePos.X, Globals.mouse.newMousePos.Y) - OFFSET);

            if (currentSkill == null)
            {
                if (Globals.mouse.LeftClick())
                {
                    GameGlobals.PassProjectile(new Fireball(new Vector2(pos.X, pos.Y), this, new Vector2(Globals.mouse.newMousePos.X, Globals.mouse.newMousePos.Y) - OFFSET));
                }
            }
            else
            {
                currentSkill.Update(OFFSET, ENEMY);
                if (currentSkill.done)
                {
                    currentSkill.Reset();
                    currentSkill = null;
                }
            }


            base.Update(OFFSET, ENEMY, GRID);
        }