public UserControl2() { InitializeComponent(); this.Hide(); color4 = System.Drawing.Color.Black; imagefond = string.Empty; this.width = Screen.PrimaryScreen.Bounds.Width; this.height = Screen.PrimaryScreen.Bounds.Height; IHave_control = false; seconde = 0; filepath = string.Empty; sauve = new Sauveguarde(); savefile = new savefile(); savefile.ia_Kamikaze = new List<couple>(); savefile.ia_tireur = new List<quaintuplet>(); savefile.ia_viseur = new List<quaintuplet>(); savefile.levelProfile = new levelProfile(); savefile.bonus = new List<Bonus>(); subdirectory = new List<string>(); type = "SEU"; Initialize(); //8,9,14,16 scrollingM = new Scrolling_ManagerV(new Microsoft.Xna.Framework.Rectangle(0, 0, width, height)); openF = false; playlist = new string[4] { "", "", "", "" }; }
public Listbox(string type, float x, float y, float _width, float _height, int WindoW, int windowH, int tab) { int X = (int)(x * (float)WindoW); int Y = (int)(y * (float)windowH); int width = (int)(_width * (float)WindoW); int height = (int)(_height * (float)windowH); selectedItem = ""; save = new Sauveguarde(); level = save.subdirectory(type); rectangle = new Rectangle[level.Length]; color = new Color[level.Length]; selected = 0; surlig = 0; oldsur = 0; Top = new Rectangle(X, Y, width, height / 10); Botom = new Rectangle(X, Y + height - height / 10, width, height / 10); right = new Rectangle(width + X - width / 10, Y, width / 10, height); left = new Rectangle(X, Y, right.Width, right.Height); fond = new Rectangle(X + right.Width, Y + Top.Height, width - right.Width - left.Width, height - 2 * height / 10); UP = new Rectangle(right.X, Y + 10, width / 10, height / 10); Down = new Rectangle(width + X - width / 10, Y + height - height / 10, width / 10, height / 10); for (int i = 0; i < level.Length; ++i) { rectangle[i] = new Rectangle(X + right.Width, Y + height / 10 * (i) + height / 10, width - 2 * right.Width, height / 10); color[i] = Color.White; } BGcolor = Color.DarkSlateGray; this.tab = tab; }
public leveleditor(Game1 game1, GraphicsDeviceManager graphics, ContentManager Content) { game1.IsMouseVisible = false; oldkey = Keyboard.GetState(); collision = new Collision(); _pause = new _Pause(game1, graphics, Content); save = new Sauveguarde(); path = game1.path; }
public void Dispose() { save = null; fondT.Dispose(); fleche.Dispose(); selectedItem = null; color = null; level = null; rectangle = null; }
public override void Initialize(GraphicsDeviceManager graphics) { // TODO: Add your initialization logic here timer = -100; game_time = 0; oldkey = Keyboard.GetState(); collision = new Collision(); save = new Sauveguarde(); // ajout IA }
public void dispose() { type = null; subdirectory = null; scrollingM = null; ovini = null; ovni = null; ia_type = null; sauve = null; manage_k.Dipose(); manage_T.Dipose(); manage_V.Dipose(); }
public void Load(ContentManager Content, levelProfile levelprofile, GraphicsDevice graph) { speed[1] = levelprofile.fc_speed / 2; speed[2] = levelprofile.fc_speed / 3; speed[0] = levelprofile.fc_speed; string name = string.Empty; for (int i = 0; i < levelprofile.background_name.Length && levelprofile.background_name[i] != '.'; ++i) { name += levelprofile.background_name[i]; if (levelprofile.background_name[i] == '\\') name = ""; } if (name == "backgroundT")// si c est un jeu normal { texture[count] = (Content.Load<Texture2D>(levelprofile.levelname + "\\" + levelprofile.background_name)); rec1[count] = new Rectangle(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); rec2[count] = new Rectangle(rectangle.X, -rectangle.Height, rectangle.Width, rectangle.Height); couche[count] = 0.9f; ++count; } else if (name == "BackgrounD")// si c est un jeu perso { Sauveguarde save = new Sauveguarde(); FileStream file = new FileStream(save._path + "\\SEU\\" + levelprofile.levelname + "\\" + levelprofile.background_name, FileMode.Open, FileAccess.Read); texture[count] = (Texture2D.FromStream(graph, file)); rec1[count] = new Rectangle(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); rec2[count] = new Rectangle(rectangle.X, -rectangle.Height, rectangle.Width, rectangle.Height); couche[count] = 0.5f; // scroll.Add(new Scrolling(texture[texture.Count - 1], new Rectangle(0, 0, windows_W, window_H), levelprofile.fc_speed, window_H, 0.5f)); ++count; } else { texture[count] = (Content.Load<Texture2D>("level2\\fond")); rec1[count] = new Rectangle(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); rec2[count] = new Rectangle(rectangle.X, -rectangle.Height, rectangle.Width, rectangle.Height); couche[count] = 0.5f; // scroll.Add(new Scrolling(texture[texture.Count - 1], new Rectangle(0, 0, windows_W, window_H), levelprofile.fc_speed, window_H, 0.5f)); ++count; } if (levelprofile.second_background != null) { texture[count] = (Content.Load<Texture2D>("back\\" + levelprofile.second_background)); rec1[count] = new Rectangle(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); rec2[count] = new Rectangle(rectangle.X, -rectangle.Height, rectangle.Width, rectangle.Height); couche[count] = 0.7f; // scroll.Add(new Scrolling(texture[texture.Count - 1], new Rectangle(0, 0, windows_W, window_H), speed1, window_H, 0.9f)); ++count; } if (levelprofile.third_bacground != null) { texture[count] = (Content.Load<Texture2D>("back\\" + levelprofile.third_bacground)); rec1[count] = new Rectangle(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); rec2[count] = new Rectangle(rectangle.X, -rectangle.Height, rectangle.Width, rectangle.Height); couche[count] = 0.1f; // scroll.Add(new Scrolling(texture[texture.Count - 1], new Rectangle(0, 0, windows_W, window_H), speed2, window_H, 1f)); ++count; } }