Esempio n. 1
0
        public ShowInfo(Screen parent, Vector2 position, Texture2D texture, Player player)
            : base(parent, position, texture)
        {
            actualPlayer = player;
            this.texture = texture;

            isMoving = false;
        }
Esempio n. 2
0
        public PanelMenu(Screen parent, Vector2 position, Texture2D texture,Player player)
            : base(parent, position, texture)
        {
            showInfoWindow = new ShowInfo(parent, new Vector2(MainGame.ScreenX - 200, 5), TexturesManager.Window ,player);
            infoPlayerButton = new Button(position, TexturesManager.InfoButton);

            infoPlayerButton.MouseClick += OnInfoPlayerMouseClick;
        }
Esempio n. 3
0
 public Player MultiToPlayer(GameScreen game, Texture2D text)
 {
     Player player = new Player(game,text);
     player.Life = Life;
     player.Power = Power;
     player.Position = Position;
     player.Direction = Direction;
     return player;
 }
Esempio n. 4
0
        public Panel(Screen parent, Vector2 position, Texture2D texture,Player player)
            : base(parent, position, texture)
        {
            infoPlayerWindow = new InfoPlayer(parent, new Vector2(MainGame.ScreenX - 200, 5), TexturesManager.Window ,player);
            spellListWindow = new SpellList(parent, new Vector2(MainGame.ScreenX - 500, 5), TexturesManager.Window, player);

            infoPlayerButton = new Button(position, TexturesManager.InfoButton);
            spellListButton = new Button(position + new Vector2(0, TexturesManager.SpellButton.Height), TexturesManager.SpellButton);

            infoPlayerButton.MouseClick += OnInfoPlayerMouseClick;
            spellListButton.MouseClick += OnSpellListMouseClick;
        }
Esempio n. 5
0
        // Gerer la projection des ennemis sur des cases interdites sinon sortie du pathfinding
        public GameScreen()
        {
            XactManager.PlaySong("Day01");

            WorldEffects = new List<WorldEffect>();

            Player = new Player(this, TexturesManager.Player); // Charge le Joueur

            Windows.Add(new Panel(this, new Vector2(0, MainGame.ScreenY / 2), TexturesManager.Window, Player));
            escapeMenu = new EscapeMenu(this, new Vector2(100, MainGame.ScreenY / 4 + 50));

            Entities = new List<Entity>();
            deletedEntities = new List<Entity>(); // On transfere un Monster deleted a l'interieur puis on le detruit dans cette liste

            IsPaused = false;
            timeSpawn = 1000;

            Camera = new Cam(MainGame.GetInstance().graphics);
        }
Esempio n. 6
0
        public GameScreen()
        {
            timeSpawn = 10000;
            WorldEffects = new List<WorldEffect>();

            Player = new Player(this, TexturesManager.Player); // Charge le Joueur

            Windows.Add(new PanelMenu(this, new Vector2(0, MainGame.ScreenY / 2), TexturesManager.Window, Player));
            escapeMenu = new EscapeMenu(this, new Vector2(100, MainGame.ScreenY / 4 + 50));

            IsPaused = false;

            Entities = new List<Entity>();
            deletedEntities = new List<Entity>(); // On transfere un Monster deleted a l'interieur puis on le detruit dans cette liste

            MapData mapData = new MapData();
            if (!mapData.FromFile("Content/Maps/map.mrm"))
                throw new Exception();
            MapFirst = new Map(mapData);

            camera = new Cam(mapData.MapWidth * 32, mapData.MapHeight * 32, MainGame.graphics);
        }
Esempio n. 7
0
 public override void Update(GameTime gameTime, MapData map, Player player)
 {
     if (Math.Sqrt((Math.Pow(Math.Abs(Position.X - player.Position.X), 2)
                    + Math.Pow(Math.Abs(Position.Y - player.Position.Y), 2))) < 10000)
     {
         new Ia(gameTime, player.Position, this,map);
     }
     base.Update(gameTime);
     // float time = (float)gameTime.ElapsedGameTime.TotalMilliseconds / 10.0f;
 }
Esempio n. 8
0
 // Pour le pathfinding
 public virtual void Update(GameTime gameTime, Player player)
 {
     stepTime += gameTime.ElapsedGameTime.TotalMilliseconds;
     while (stepTime >= StepDelay)
     {
         stepTime -= StepDelay;
         if (++Step >= frameCount[0])
             Step = 0;
     }
 }
Esempio n. 9
0
 public override void Update(GameTime gameTime, Player player)
 {
     ia.Moving(gameTime, player);
     base.Update(gameTime);
 }