Example #1
0
 //Real position
 public static bool IsInRectangle(Rectangle rectangle, Cam camera)
 {
     return (camera.Location(Position).X > rectangle.Left &&
         camera.Location(Position).X < rectangle.Right &&
         camera.Location(Position).Y > rectangle.Top &&
         camera.Location(Position).Y < rectangle.Bottom);
 }
Example #2
0
 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);
 }
Example #3
0
 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);
 }
Example #4
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);
        }
Example #5
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);
        }
Example #6
0
 public void BeginCam(Cam camera)
 {
     spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera.GetTransformation());
 }