/// <summary> ///jeu level perso chargement /// </summary> /// <param name="level">nom du niveau</param> /// <param name="iamanage_K">manager de ia</param> /// <param name="iamanage_T"></param> /// <param name="iamanage_V"></param> public void load_leveleditor_SEU(ContentManager Content, string level, ref IA_manager_K iamanage_K, ref IA_manager_T iamanage_T, ref IA_manager_V iamanage_V, ref Scrolling_ManagerV scrollM, ref GraphicsDevice grap, ref sripte_V sprite, ref Ovni ovni) { savefile savefile = new savefile(); load_SEU(ref level, ref savefile); for (int j = 0; j < savefile.ia_tireur.Count; ++j) iamanage_T.Add(savefile.ia_tireur[j]); for (int j = 0; j < savefile.ia_viseur.Count; ++j) iamanage_V.Add(savefile.ia_viseur[j]); for (int j = 0; j < savefile.ia_Kamikaze.Count; ++j) iamanage_K.Add(savefile.ia_Kamikaze[j]); for (int j = 0; j < savefile.bonus.Count; ++j) ovni.Add(savefile.bonus[j]); scrollM.Load(Content, savefile.levelProfile, grap); sprite.parametrage(ref savefile.levelProfile); ovni.param(savefile.levelProfile.fc_speed); }
public override void LoadContent(ContentManager Content, GraphicsDevice graph, ref string level, ref string next, GraphicsDeviceManager graphics) { //charge le fond // bacgkround1 = Content.Load<Texture2D>("level2//fond"); // background2 = Content.Load<Texture2D>("level2//fond2"); //charge le sprite fond = new Rectangle(400, 0, width/2, height); Scroll = new Scrolling_ManagerV(fond); T_sprite = Content.Load<Texture2D>("hero//spriteSheet"); //charge l IA aster_t = Content.Load<Texture2D>("spritesheet"); planet1 = Content.Load<Texture2D>("IA/asteroid/planet4"); star = Content.Load<Texture2D>("IA/asteroid/star"); //instancie le scolling // scrolling1 = new Scrolling(bacgkround1, new Rectangle(0, 0, width, height), 2, height,0.01f); // scrolling2 = new Scrolling(background2, new Rectangle(0, 0, width, height), 3, height,1f); //intancie le vaisseau vaisseau = new sripte_V( new Rectangle(height / 2 + taille_sprt / 2, width / 2 + taille_sprt / 2, sizeX , sizey ), height, width); //instancie l ia // aster = new asteroid(aster_t, new Rectangle(100, 75, taille_sprt, taille_sprt), 0.01f, width, height); manage_T = new IA_manager_T(planet1, new Rectangle(0, 0, taille_sprt, taille_sprt), Content,fond); manage_V = new IA_manager_V(star, new Rectangle(0, 0, taille_sprt, taille_sprt), Content,fond); manage_k = new IA_manager_K(aster_t, new Rectangle(0, 0, taille_sprt, taille_sprt),fond); ovini = new Ovni(width, height); ovini.Load(aster_t); // ajout IA save.load_leveleditor_SEU(Content, level, ref manage_k, ref manage_T, ref manage_V, ref Scroll, ref graph,ref vaisseau , ref ovini ); vaisseau.Load(Content, T_sprite); //instancie les donnees de la pause _pause.LoadContent(Content); }
public override void LoadContent(ContentManager Content, GraphicsDevice graph, ref string level, ref string next, GraphicsDeviceManager graphics) { width = graphics.PreferredBackBufferWidth; height = graphics.PreferredBackBufferHeight; ovini = new Ovni(width, height); taille_sprt = (int)(Math.Min(width, height) * 0.05); taille_sprt2 = (int)(Math.Min(width, height) * 0.08); //charge le fond // background1 = Content.Load<Texture2D>("level2//fond"); // background2 = Content.Load<Texture2D>("back//fond2"); //charge le sprite _pause.initbutton(ref level); T_sprite = Content.Load<Texture2D>("hero//spriteSheet"); fond =new Rectangle(width/4 , 0, width / 2, height); scroll = new Scrolling_ManagerV(fond ); //charge l IA aster_t = Content.Load<Texture2D>("IA/asteroid/asteroide-sprite"); planet1 = Content.Load<Texture2D>("IA/asteroid/planet4"); star = Content.Load<Texture2D>("IA/asteroid/star"); //instancie le scolling // scrolling1 = new Scrolling(bacgkround1, new Rectangle(0, 0, width, height), 2, height,1f); // scrolling2 = new Scrolling(background2, new Rectangle(0, 0, width, height), 3, height,0.5f); //intancie le vaisseau vaisseau = new sripte_V( new Rectangle(height / 2 + taille_sprt / 2, width / 2 + taille_sprt / 2, taille_sprt2, taille_sprt2), height, width); //instancie l ia manage_T = new IA_manager_T(planet1, new Rectangle(0, 0, taille_sprt2, taille_sprt2), Content, fond); manage_V = new IA_manager_V(star, new Rectangle(0, 0, taille_sprt, taille_sprt), Content, fond); manage_k = new IA_manager_K(aster_t, new Rectangle(0, 0, taille_sprt, taille_sprt),fond); //instancie les donnees de la pause _pause.LoadContent(Content); ovini.Load(aster_t); // ajout IA save.load_level_SEU(Content,ref level,ref next , ref manage_k, ref manage_T, ref manage_V, ref scroll, ref graph, ref vaisseau,ref ovini ); vaisseau.Load(Content, T_sprite); }
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 void update(ref IA_manager_T manage_T, ref IA_manager_V manage_V, ref IA_manager_K manage_k, ref KeyboardState keybord, Game1 game, ref Scrolling_ManagerV scrollM, ref Ovni ovni) { manage_T = this.manage_T; manage_V = this.manage_V; manage_k = this.manage_k; scrollM = this.scrollingM; ovni = this.ovni; this.game = game; if (keybord.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Up)) ++seconde; if (keybord.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Down)) --seconde; }
public void LoadContent(IA_manager_T manage_T, IA_manager_V manage_V, IA_manager_K manage_k, Scrolling_ManagerV scrolling, ContentManager Content, Ovni ovni) { this.manage_T = manage_T; this.manage_V = manage_V; this.manage_k = manage_k; this.ovni = ovni; this.scrollingM = scrolling; this.Content = Content; string[] item = sauve.filename(Content); for (int i = 0; i < item.Length; ++i) { } ovni = new Ovni(width, height); ovni.param(3); }
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 override void LoadContent(ContentManager Content, GraphicsDevice graph, ref string level, ref string next, GraphicsDeviceManager graphics) { _pause.initbutton(ref level); Scroll_manager = new Scrolling_ManagerV(new Rectangle(0,0,width,height )); //charge le fond // bacgkround1 = Content.Load<Texture2D>(backGround); //charge le sprite T_sprite = Content.Load<Texture2D>("hero//spriteSheet"); //charge l IA aster_t = Content.Load<Texture2D>("IA/asteroid/asteroide-sprite"); planet1 = Content.Load<Texture2D>("IA/asteroid/planet4"); star = Content.Load<Texture2D>("IA/asteroid/star"); //instancie le scolling manage_T = new IA_manager_T(planet1, new Rectangle(0, 0, taille_sprt, taille_sprt), Content, height, width); manage_V = new IA_manager_V(star, new Rectangle(0, 0, taille_sprt, taille_sprt), Content, height, width); manage_k = new IA_manager_K(aster_t, new Rectangle(0, 0, taille_sprt, taille_sprt), height, width); //intancie le vaisseau vaisseau = new sripte_V( new Rectangle(height / 2 + taille_sprt / 2, width / 2 + taille_sprt / 2, taille_sprt, taille_sprt), height, width); vaisseau.Load(Content, T_sprite); ovni = new Ovni(width, height); ovni.param(3); ovni.Load(aster_t); //instancie les donnees de la pause _pause.LoadContent(Content); user.LoadContent(manage_T, manage_V, manage_k, Scroll_manager, Content, ovni); }
/// <summary> /// jeu normal chargement /// </summary> /// <param name="Content"></param> /// <param name="level">nom du nivau</param> /// <param name="iamanage_K"></param> /// <param name="iamanage_T"></param> /// <param name="iamanage_V"></param> public void load_level_SEU(ContentManager Content, ref string level, ref string next, ref IA_manager_K iamanage_K, ref IA_manager_T iamanage_T, ref IA_manager_V iamanage_V, ref Scrolling_ManagerV scrollM, ref GraphicsDevice grash, ref sripte_V sprite, ref Ovni ovni) { savefile savefil = new savefile(); FileStream file1 = null; XmlSerializer f = null; DirectoryInfo dir = null; dir = new DirectoryInfo(Content.RootDirectory + "\\" + level); if (dir.Exists) { file1 = new FileStream(dir.FullName + "\\level.lvl", FileMode.Open, FileAccess.Read); f = new XmlSerializer(typeof(savefile)); savefil = (savefile)f.Deserialize(file1); file1.Close(); } for (int j = 0; j < savefil.ia_tireur.Count; ++j) iamanage_T.Add(savefil.ia_tireur[j]); for (int j = 0; j < savefil.ia_viseur.Count; ++j) iamanage_V.Add(savefil.ia_viseur[j]); for (int j = 0; j < savefil.ia_Kamikaze.Count; ++j) iamanage_K.Add(savefil.ia_Kamikaze[j]); for (int j = 0; j < savefil.bonus.Count; ++j) ovni.Add(savefil.bonus[j]); scrollM.Load(Content, savefil.levelProfile, grash); sprite.parametrage(ref savefil.levelProfile); ovni.param(savefil.levelProfile.fc_speed); next = savefil.levelProfile.next_level; }