public SoloScreen() { Reseau = false; MapData mapData = new MapData(); if (!mapData.FromFile("Content/Maps/map.mrm")) throw new Exception(); MapFirst = new Map(mapData); Camera = new Cam(MainGame.GetInstance().graphics); }
public Ia(MapData mapData, Monster monster) { map = mapData; this.monster = monster; direction = Direction.Down; inVision = false; OutRange = true; isPatrolling = true; }
public MultiScreen(Client client) { IsClient = true; this.client = client; Reseau = true; MapData mapData = new MapData(); if (!mapData.FromFile("Content/Maps/map.mrm")) throw new Exception(); MapFirst = new Map(mapData); Camera = new Cam(MainGame.GetInstance().graphics); }
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); }
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; }
public Map(MapData map) { Data = map; }
// Pour le pathfinding public virtual void Update(GameTime gameTime, MapData map, Player player) { stepTime += gameTime.ElapsedGameTime.TotalMilliseconds; while (stepTime >= StepDelay) { stepTime -= StepDelay; if (++Step >= frameCount[0]) Step = 0; } }
public static int VectToId(MapData map, Vector2 pos) { return (int)(pos.X / 32) + (int)(pos.Y / 32) * map.MapWidth; }