예제 #1
0
        public void SetTarget(MainHero hero)
        {
            int d = hero.GetDirection();

            if (d == 0)
            {
                this.targetx = hero.GetX();
                this.targety = hero.GetY() + 4;
            }
            else if (d == 1)
            {
                this.targetx = hero.GetX() + 4;
                this.targety = hero.GetY();
            }
            else if (d == 2)
            {
                this.targetx = hero.GetX();
                this.targety = hero.GetY() - 4;
            }
            else if (d == 3)
            {
                this.targetx = hero.GetX() - 4;
                this.targety = hero.GetY();
            }
        }
예제 #2
0
        public void SetTarget(MainHero hero, BLINKY b)
        {
            int x = 0, y = 0;
            int d = hero.GetDirection();

            if (d == 0)
            {
                x = hero.GetX();
                y = hero.GetY() + 2;
            }
            else if (d == 1)
            {
                x = hero.GetX() + 2;
                y = hero.GetY();
            }
            else if (d == 2)
            {
                x = hero.GetX();
                y = hero.GetY() - 2;
            }
            else if (d == 3)
            {
                x = hero.GetX() - 2;
                y = hero.GetY();
            }

            this.targetx = x + x - b.x;
            this.targety = y + y - b.y;
        }