Exemplo n.º 1
0
 public void LoadEnemy(string type)
 {
     enemy = new Enemy();
     enemy.Initialize(type,content.ServiceProvider,0,new Options());
     if (!textures.ContainsKey(type))
     {
         LoadTextures(enemy.Variables, type);
     }
 }
Exemplo n.º 2
0
        public void RemoveEnemy(Enemy enemy)
        {
            enemy.Dispose();
            foreach (List<Enemy> enemyList in enemies)
            {
                enemyList.Remove(enemy);
            }

            refreshAllEnemies();
        }
Exemplo n.º 3
0
        public void AddEnemy(string type, Vector2 position,Star.Game.Enemy.Enemy.StandardDirection startdirection,Options options)
        {
            Enemy newenemy;

            newenemy = new Enemy();
            newenemy.Initialize(type, serviceProvider,(byte)currentThreadtoAdd,options);
            //preloadedEnemies.Add(newenemy);
            newenemy.Pos = position;
            //newenemy.RunDirection = startdirection;
            if (!textures.ContainsKey(type))
            {
                LoadTextures(content, newenemy.Variables, type);
            }
            newenemy.Alive = true;
            enemies[currentThreadtoAdd].Add(newenemy);
            currentThreadtoAdd++;
            if (currentThreadtoAdd >= numThreads)
                currentThreadtoAdd = 0;
            refreshAllEnemies();
        }
Exemplo n.º 4
0
 protected void Initialize(string name)
 {
     mousepos = new Vector2();
     oldMousePos = new Vector2();
     offset = new Vector2(12,128);
     formlocation = new Vector2();
     editorlocation = new Vector2();
     ContentManager content2 = new ContentManager(Services, "StarEditData");
     font = content2.Load<SpriteFont>("Arial");
     content = new ContentManager(Services);
     content.RootDirectory = "Data";
     spriteBatch = new SpriteBatch(GraphicsDevice);
     enemy = new Enemy();
     enemy.Alive = true;
     textures = new Dictionary<string, Texture2D>();
     tex = content.Load<Texture2D>("Stuff/Blank");
     if (name != null)
     {
         enemy.Initialize(name, Services,0,new Options());
         LoadTextures();
     }
     else
     {
         enemy.Initialize( Services, new Options());
     }
     playcontrol.Initialize(Services);
     playcontrol.Max = enemy.Animations.CurrentAnimationKeyFrameCount;
     //playcontrol.TotalKeyFrames = enemy.Animations.CurrentAnimationKeyFrameCount;
     playcontrol.Value = enemy.Animations.CurrentAnimationKeyFrameValue;
     playcontrol.Width = this.Size.Width;
     playcontrol.PlayControlClicked += new PlayControlClickEvent.PlayControlEventHandler(playcontrol_PlayControlClicked);
     //playcontrol.Offset = new Vector2(0, 50) + new Vector2(this.Location.X,this.Location.Y);
     modifyCollision = new bool[Enum.GetValues(typeof(LiveEdit)).Length];
 }
Exemplo n.º 5
0
 public void SetModifyRectangle(Enemy.CollisionRects colRects)
 {
     this.colRect = colRects;
 }
Exemplo n.º 6
0
 public void LoadEnemy(string name)
 {
     enemy = new Star.Game.Enemy.Enemy();
     enemy.Alive = true;
     enemy.Initialize(name, Services, 0,new Options());
     LoadTextures();
 }