/// <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 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 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); }
public void h_M1P(ref IA_manager_V AA, ref IA_manager_T AR, ref IA_manager_K K, ref sripte_V pl) { for (int i = 0; i < AA.bulletL.Count; ++i) { if (AA.bulletL[i].rectangle_C.Intersects(pl.rectangle_C)) { pl.vie -= AA.bulletL[i].degat; AA.bulletL.RemoveAt(i); } } for (int i = 0; i < AR.bulletL.Count; ++i) { if (AR.bulletL[i].rectangle_C.Intersects(pl.rectangle_C)) { pl.vie -= AR.bulletL[i].degat; AR.bulletL.RemoveAt(i); } } for (int i = 0; i < AA.Ia_manage.Count; ++i) { for (int j = 0; j < pl.bulletL.Count; ++j) { if (pl.bulletL[j].rectangle_C.Intersects(AA.Ia_manage[i].rectangle_C)) AA.Ia_manage[i].vie -= pl.bulletL[i].degat; } if (AA.Ia_manage[i].rectangle_C.Intersects(pl.rectangle_C)) { pl.vie -= 30; AA.Ia_manage.RemoveAt(i); } } for (int i = 0; i < AR.Ia_manage.Count; ++i) { for (int j = 0; j < pl.bulletL.Count; ++j) { if (pl.bulletL[j].rectangle_C.Intersects(AR.Ia_manage[i].rectangle_C)) AR.Ia_manage[i].vie -= pl.bulletL[i].degat; } if (AR.Ia_manage[i].rectangle_C.Intersects(pl.rectangle_C)) { pl.vie -= 30; AR.Ia_manage.RemoveAt(i); } } for (int i = 0; i < K.Ia_manage.Count; ++i) { for (int j = 0; j < pl.bulletL.Count; ++j) { if (pl.bulletL[j].rectangle_C.Intersects(K.Ia_manage[i].rectangle_C)) K.Ia_manage[i].vie -= pl.bulletL[i].degat; } if (K.Ia_manage[i].rectangle_C.Intersects(pl.rectangle_C)) { pl.vie -= K.Ia_manage[i].damage; AA.Ia_manage.RemoveAt(i); } } }
/// <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; }