Exemple #1
0
        public static Enemy CreateWanderer(Viewport viewport, Texture2D texture, Vector2 position)
        {
            var enemy = new Enemy(viewport, texture, position);
            enemy.AddBehaviour(enemy.MoveRandomly());
            enemy.PointValue = 50;

            return enemy;
        }
Exemple #2
0
        public static Enemy CreateSeeker(Viewport viewport, Texture2D texture, Vector2 position)
        {
            var enemy = new Enemy(viewport, texture, position);
            enemy.AddBehaviour(enemy.FollowPlayer(0.9f));
            enemy.PointValue = 100;

            return enemy;
        }
        public Level(int i,Camera c, Model m, Model m2,Model e)
        {
            level = i;
            camera = c;
            model = m;
            model2 = m2;

            for (int j = 0; j < enemy.Length; j++)
            {

                Vector3 vec = new Vector3(4*j, -3.7f, 4*j+50);
                enemy[j] = new Enemy(e, vec);
                enemy[j].setLevel(this);
            }
        }
Exemple #4
0
 public void HandleCollision(Enemy other)
 {
     var d = Position - other.Position;
     Velocity += 10 * d / (d.LengthSquared() + 1);
 }