public SceneExtras(Rectangle windowSize, KeyboardState keyboardState, MouseState mouseState) { _windowSize = windowSize; _mouseState = mouseState; _keyboardState = keyboardState; selectedSprite = 0; currentSize = 150; tailleSelection = new Sprite(new Rectangle(0, _windowSize.Height - 85, windowSize.Width, 85), windowSize); mouse = new AnimatedSprite(new Rectangle(-100, -100, 60, 80), _windowSize, 8, 4, 30); animations = new List<AnimatedSprite>(); menu = new ContextMenu(_windowSize, new AnimatedSprite(new Rectangle(200, 50, 300, 50), _windowSize, "menu/ContextualMenuBlackFull"), "menu/contextMenuExit", 100); menu.Title = new AnimatedSprite(new Rectangle(menu.Position.Width / 2 - 75, 0, 150, 50), _windowSize, "menu/contextMenuText"); menu.Visible = false; menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/canalisation1_16x13", 16, 13)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion0_8x6", 8, 6)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion1_8x6", 8, 6)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion2_8x8", 8, 8)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion3_8x4", 8, 4)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/explosion4_8x8", 8, 8)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/fireWall_11x6r23r44", 11, 6)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/popGreen_8x4", 8, 4)); menu.Add(new AnimatedSprite(new Rectangle(), windowSize, "sprites/spriteElectric_11x3r12r23", 11, 3)); menu.CuadricPositionning(new Rectangle(0, 0, 75, 75), 100, 20, 3, 3, true); menu.Add(new AnimatedSprite(new Rectangle(menu.Position.Width / 2 - 100, 65, 200, 22), _windowSize, "menu/contextMenuTextMainMenu")); }
public InGame(Rectangle windowSize, KeyboardState keyboardState, MouseState mouseState) { _windowSize = windowSize; _mouseState = mouseState; _keyboardState = keyboardState; _menu = new ContextMenu(_windowSize, new AnimatedSprite(new Rectangle(0, 30, 200, 50), _windowSize, "menu/ContextualMenuBlackFull"), "menu/contextMenuExit", 235); _menu.Title = new AnimatedSprite(new Rectangle(_menu.Position.Width / 2 - 75, 0, 150, 50), _windowSize, "menu/contextMenuText"); _menu.Visible = false; _menu.Add(new AnimatedSprite(new Rectangle(_menu.Position.Width / 2 - 100, 65, 200, 22), _windowSize, "menu/contextMenuTextMainMenu")); _menu.CuadricPositionning(new Rectangle(0, 0, 150, 20), 65, 15, 10, 10, true); mouse = new Sprite(new Rectangle(-100, -100, 30, 50), _windowSize); map = new AbstractMap(_windowSize); map.Visitable.Add(new Rectangle(450, 330, 1800, 150)); map.VuePosition = new Vector2(460, 330 + 150 - 1); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "map1/sky1"), 0.2f, 0, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "map1/back1r"), 0.8f, 0.2f, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, _windowSize.Height / 2, _windowSize.Width, _windowSize.Height / 2), _windowSize, "map1/fore1"), 1f, 0.5f, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(5, 150, _windowSize.Width / 2, _windowSize.Height - 150), _windowSize, "sprites/fireWall_11x6r23r44", 11, 6, 30, 23, 44, 1, true), 1f, 0.5f)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(1800 + _windowSize.Width / 2, 150, _windowSize.Width / 2 - 20, _windowSize.Height - 150), _windowSize, "sprites/fireWall_11x6r23r44", 11, 6, 30, 23, 44, 1, true), 1f, 0.5f)); personnage = new Sprite(new Rectangle((int)map.VuePosition.X - 50, (int)map.VuePosition.Y - 50, 100, 100), _windowSize, "game/bear"); }
public InGame(Rectangle windowSize, KeyboardState keyboardState, MouseState mouseState) { _windowSize = windowSize; _mouseState = mouseState; _keyboardState = keyboardState; _originalWindowSize = windowSize; _menu = new ContextMenu(_windowSize, new AnimatedSprite(new Rectangle(0, 30, 200, 50), _windowSize, "menu/ContextualMenuBlackFull"), "menu/contextMenuExit", 235); _menu.Title = new AnimatedSprite(new Rectangle(_menu.Position.Width / 2 - 75, 0, 150, 50), _windowSize, "menu/contextMenuText"); _menu.Visible = false; _menu.Add(new AnimatedSprite(new Rectangle(_menu.Position.Width / 2 - 100, 65, 200, 22), _windowSize, "menu/contextMenuTextMainMenu")); _menu.CuadricPositionning(new Rectangle(0, 0, 150, 20), 65, 15, 10, 10, true); mouse = new Sprite(new Rectangle(-100, -100, 30, 50), _windowSize); _maps = new List<AbstractMap>(); AbstractMap map; map = new AbstractMap(_windowSize); map.AddVisitable(450, 450, 2800, 130); map.VuePosition = new Vector2(460, 450 + 130 - 1); /*map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "map1/sky1"), 0.2f, 0, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "map1/back1r"), 0.8f, 0.2f, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, _windowSize.Height / 2, _windowSize.Width, _windowSize.Height / 2), _windowSize, "map1/fore1"), 1f, 0.5f, true));*/ map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), windowSize, "map1/sky1"), 0.2f, 0, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 190, 960, 300), windowSize, "map1/back1r"), 0.8f, 0.2f, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 415, 1082, 193), windowSize, "map1/fore1"), 1f, 0.5f, true)); //map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 515, 1066, 92), windowSize, "map1/fore1"), 1f, 0.5f, true, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(5, 150, _windowSize.Width / 2, _windowSize.Height - 150), _windowSize, "sprites/fireWall_11x6r23r44", 11, 6, 30, 23, 44, 1, true), 1f, 0.5f)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(2550 + _windowSize.Width / 2, 280, 320, 320), _windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, true)); _maps.Add(map); map = new AbstractMap(_windowSize); map.AddVisitable(450, 450, 2800, 130); map.VuePosition = new Vector2(460, 450 + 130 - 1); /*map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "map1/sky1"), 0.2f, 0, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, _windowSize.Width, _windowSize.Height), _windowSize, "map1/back1r"), 0.8f, 0.2f, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, _windowSize.Height / 2, _windowSize.Width, _windowSize.Height / 2), _windowSize, "map1/fore1"), 1f, 0.5f, true));*/ map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 0, 1040, 320), windowSize, "map2/sky"), 0.2f, 0, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 190, 960, 300), windowSize, "map2/mountain"), 0.8f, 0.2f, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 415, 1082, 193), windowSize, "map2/sand"), 1f, 0.5f, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(0, 515, 1066, 92), windowSize, "map2/rock"), 1f, 0.5f, true, true)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(250, 280, 320, 320), _windowSize, "sprites/portal_6x6", 6, 6, 30, 1, 32, 1, true), 1f, 0.5f, false, false, true, false)); map.Elements.Add(new AbstractMap.Element(new AnimatedSprite(new Rectangle(2800 + _windowSize.Width / 2, 150, _windowSize.Width / 2, _windowSize.Height - 150), _windowSize, "sprites/fireWall_11x6r23r44", 11, 6, 30, 23, 44, 1, true), 1f, 0.5f)); _maps.Add(map); _currentMap = 0; personnage = new Personnage(_windowSize, map.VuePosition); _mobsTextures = new List<Texture2D>(); _mobs = new List<List<Mob>>(); rand = new Random(); _mobs.Add(new List<Mob>()); _mobs.Add(new List<Mob>()); for (int i = 0; i < 30; i++) _mobs[0].Add(new Mob(_windowSize, rand.Next(), new Vector2(1000, 580), 100, 200, "game/blitz", 5, 4, new Vector2(3f, 3f), new Vector2(1f, 0.5f), 300, 50, new Rectangle(900, 485, 2000, 100))); for (int i = 0; i < 50; i++) _mobs[1].Add(new Mob(_windowSize, rand.Next(), new Vector2(1000, 580), 100, 200, "game/blitz", 5, 4, new Vector2(3f, 3f), new Vector2(1f, 0.5f), 300, 50, new Rectangle(900, 485, 2000, 100))); foreach (List<Mob> l in _mobs) foreach (Mob m in l) { m.AddGraphicalBounds(CharacterActions.WalkRight, new Rectangle(6, 6, 10, 30)); m.AddGraphicalBounds(CharacterActions.WalkLeft, new Rectangle(1, 1, 5, 30)); m.AddGraphicalBounds(CharacterActions.StandLeft, new Rectangle(3, 3, 3, 30)); m.AddGraphicalBounds(CharacterActions.StandRight, new Rectangle(8, 8, 8, 30)); m.AddGraphicalBounds(CharacterActions.Attack1Left, new Rectangle(11, 11, 12, 4)); m.AddGraphicalBounds(CharacterActions.Attack1Right, new Rectangle(16, 16, 17, 4)); m.AddGraphicalBounds(CharacterActions.ReceiveAttackLeft, new Rectangle(13, 13, 13, 4)); m.AddGraphicalBounds(CharacterActions.ReceiveAttackRight, new Rectangle(18, 18, 18, 4)); } _hud = new HUD(_windowSize); }