Ejemplo n.º 1
0
        public override void Initialize()
        {
            Cursor.SetVisibility(true);
            armor = new Entity(new Pos(230, 14));
            armor.LoadContent("inventory", "2", "3", "3");

            weapons = new Entity(new Pos(260, 15));
            weapons.LoadContent("inventory", "10", "11", "11");

            div = new Entity(new Pos(314, 13));
            div.LoadContent("inventory", "6", "7", "7");

            quest = new Entity(new Pos(340, 16));
            quest.LoadContent("inventory", "8", "9", "9");

            cons = new Entity(new Pos(287, 8));
            cons.Initialize();
            cons.LoadContent("inventory", "4", "5", "5");

            _inv = new Entity(new Pos(15, 10));
            _inv.LoadContent("inventory", "1");

            shit = new Entity(new Pos(225, 50), false);
            shit.LoadContent("inventory", "12");

            overshit = new Ennemy(new Pos(225, 50), false);
            overshit.LoadContent("inventory", "13");
        }
Ejemplo n.º 2
0
        public override void Initialize()
        {
            background = new Entity(new Pos(C.Screen.Width/2, C.Screen.Height/2));
            background.LoadContent("options menu", "1", Center.All);

            sonEnabled = new Entity(new Pos(background.Pos.X + background.Rect.Width / 2, background.Pos.Y + background.Rect.Height / 2));
            sonEnabled.LoadContent("options menu", "2", "3", "2", Center.All);

            sonDisabled = new Entity(sonEnabled.Pos, false);
            sonDisabled.LoadContent("options menu", "4", "5", "4");

            volume = new Entity(new Pos(background.Pos.X + background.Rect.Width / 2 - 130, background.Pos.Y + background.Rect.Height / 2 - 100));
            volume.LoadContent("options menu", "6", Center.All);

            luminosite = new Entity(new Pos(background.Pos.X + background.Rect.Width / 2 + 130, background.Pos.Y + background.Rect.Height / 2 - 100));
            luminosite.LoadContent("options menu", "7", Center.All);

            retour = new Entity(new Pos(background.Pos.X + background.Rect.Width / 2, background.Pos.Y + background.Rect.Height / 2 + 100));
            retour.LoadContent("pause menu", "2", "6", "2", Center.All);

            cannaVol = new Entity(new Pos(volume.Pos.X + volume.Rect.Width - 42, volume.Pos.Y + 38));
            cannaLum = new Entity(new Pos(luminosite.Pos.X + luminosite.Rect.Width / 2, luminosite.Pos.Y + 38));
            cannaVol.LoadContent("options menu", "8", "9", "10");
            cannaLum.LoadContent("options menu", "8", "9", "10");
        }
Ejemplo n.º 3
0
Archivo: Game.cs Proyecto: Lyloox/Abimn
        protected override void Initialize()
        {
            Rand.Init();
            G.currentGame = new Stack<GameType>();
            G.content = new Hashtable();

            this.graphics.IsFullScreen = false;
            this.graphics.PreferredBackBufferWidth = C.Screen.Width;
            this.graphics.PreferredBackBufferHeight = C.Screen.Height;
            this.graphics.ApplyChanges();
            this.Window.Title = "Abimn";
            this.Window.AllowUserResizing = true;

            base.Initialize();

            Cursor.Initialize();
            Cursor.SetCursor("cursor", "default", "clicked", new Pos(-15, -5));

            Music.Volume = 7;
            G.brightness = 50;

            black = new Entity();
            black.LoadContent("black");
            black.Opacity = 0;
            white = new Entity();
            white.LoadContent("white");
            white.Opacity = 0;

            G.currentGame.Push(new Menu());
        }
Ejemplo n.º 4
0
        public override void Initialize()
        {
            Music.Stop();
            background = new Entity();
            background.LoadContent("fight", "7");

            exit = new Entity(new Pos(C.Screen.Width / 2, 400));
            exit.LoadContent("fight recap", "2", Center.All);
        }
Ejemplo n.º 5
0
        public override void Initialize()
        {
            fond = new Entity(new Pos(C.Screen.Width / 2, C.Screen.Height / 2));
            fond.LoadContent("fight recap", "1", Center.All);

            exit = new Entity(new Pos(fond.Pos.X + 70, fond.Pos.Y + 370));
            exit.LoadContent("fight recap", "2");

            one = Rand.Int(20, 60);
            two = Rand.Int(75, 100);
        }
Ejemplo n.º 6
0
 public Vector2 getDirection(Entity needMove, Entity e2, bool move)
 {
     Vector2 left = new Vector2(-1, 0f);
     Vector2 right = new Vector2(1, 0f);
     if (move)
     {
         if (needMove.Pos.X < e2.Pos.X)
         {
             needMove.LoadContent("fight", "10");
             return right;
         }
         else if (needMove.Pos.X > e2.Pos.X)
         {
             needMove.LoadContent("fight", "3");
             return left;
         }
         else
             return new Vector2(0, 0);
     }
     else
         return new Vector2(0, 0);
 }
Ejemplo n.º 7
0
        public override void Initialize()
        {
            Cursor.SetVisibility(true);

            fond_menu = new Entity();
            fond_menu.Initialize(new Pos(fond_menu.Pos.X+112,fond_menu.Pos.Y+ 94));
            fond_menu.LoadContent("pause menu", "1");

            resume = new Entity(new Pos(fond_menu.Pos.X + 250, fond_menu.Pos.Y + 195));
            resume.LoadContent("pause menu", "2", "6", "2");
            exit = new Entity(new Pos(fond_menu.Pos.X + 250, fond_menu.Pos.Y + 355));
            exit.LoadContent("pause menu", "4", "7", "4");
            option = new Entity(new Pos(fond_menu.Pos.X + 250, fond_menu.Pos.Y + 275));
            option.LoadContent("pause menu", "3", "5", "3");
        }
Ejemplo n.º 8
0
Archivo: Menu.cs Proyecto: Lyloox/Abimn
        public Menu()
            : base(true)
        {
            Cursor.setCursor(Tiles.Cursor, 1, 2, new Pos(15, 5));

            create = new Button(new Pos((int)(C.Screen.Width * 0.15), (int)(C.Screen.Height * 0.30)));
            create.LoadContent(1, 4, 4, Tiles.Button);

            load = new Button(new Pos((int)(C.Screen.Width * 0.15), (int)(C.Screen.Height * 0.45)));
            load.LoadContent(2, 5, 5, Tiles.Button);

            quit = new Button(new Pos((int)(C.Screen.Width * 0.15), (int)(C.Screen.Height * 0.60)));
            quit.LoadContent(3, 6, 6, Tiles.Button);

            background = new Entity();
            background.LoadContent(1, Tiles.Menu);
        }
Ejemplo n.º 9
0
Archivo: Menu.cs Proyecto: Lyloox/Abimn
        public override void Initialize()
        {
            G.willFightBoss = false;
            Music.Play("lullaby");
            Hero.LifeMax = 10000;
            Hero.Life = 10000;
            Cursor.SetVisibility(true);

            play = new Entity(new Pos(C.Screen.Width * 0.15, C.Screen.Height * 0.30));
            play.LoadContent("menu principal", "1", "2", "1");

            options = new Entity(new Pos(C.Screen.Width * 0.15, C.Screen.Height * 0.45));
            options.LoadContent("menu principal", "3", "4", "3");

            quit = new Entity(new Pos(C.Screen.Width * 0.15, C.Screen.Height * 0.60));
            quit.LoadContent("menu principal", "5", "6", "5");

            background = new Entity();
            background.LoadContent("menu principal/7");
        }
Ejemplo n.º 10
0
        public MapSelector(bool creating)
            : base(true)
        {
            this.creating = creating;
            maps = System.IO.File.ReadAllLines(C.mapsPath);
            byte i = 0;

            while (i < C.nbSlots)
                slotIsEmpty[i] = maps[i++] == "";
            for (i = 0; i < slots.Length; i++)
            {
                slots[i] = new Button(new Pos(C.Screen.Width / 2 + (i < slots.Length / 2 ? -200 : 200), C.Screen.Height / 2 - 150 + (i%(slots.Length/2)) * 100));
                slots[i].LoadContent(slotIsEmpty[i] ? 9 : i + 1, slotIsEmpty[i] ? 10 : i + 11, slotIsEmpty[i] ? 10 : i + 11, Tiles.Slot, Center.All);
            }
            back = new Button();
            back.LoadContent(21, 22, 22, Tiles.Slot);
            back.Pos = new Pos(C.Screen.Width - back.Rect.Width, C.Screen.Height - back.Rect.Height);

            background = new Entity();
            background.LoadContent(1, Tiles.Menu);

            //id = id >= maps.Length ? maps.Length - 1 : id;
            //this.load(maps[id]);
        }
Ejemplo n.º 11
0
        public override void Initialize()
        {
            /* le edit background devra etre en plein ecran*/
            EditBackground = new Entity(new Pos(C.Screen.Width / 2, C.Screen.Height / 2));
            EditBackground.LoadContent("char edit", "background", Center.All);

            EditBackground2 = new Entity(new Pos(C.Screen.Width / 2, C.Screen.Height / 2),false);
            EditBackground2.LoadContent("char edit", "21", Center.All);

            EditBackground3 = new Entity(new Pos(C.Screen.Width / 2, C.Screen.Height / 2),false);
            EditBackground3.LoadContent("char edit", "22", Center.All);

            quit = new Entity(new Pos(C.Screen.Width - 245, C.Screen.Height - 95));
            quit.LoadContent("char edit", "9", "10", "9");

            next = new Entity(new Pos(C.Screen.Width - 455, C.Screen.Height - 95));
            next.LoadContent("char edit", "7", "8", "7");

            next2 = new Entity(new Pos(C.Screen.Width-455, C.Screen.Height-95 ),false);
            next2.LoadContent("char edit", "7", "8", "7");

            back = new Entity(new Pos(C.Screen.Width - 245, C.Screen.Height - 95),false);
            back.LoadContent("char edit", "11", "12", "11");

            back2 = new Entity(new Pos(C.Screen.Width - 245, C.Screen.Height - 95), false);
            back2.LoadContent("char edit", "11", "12", "11");

            play = new Entity(new Pos(C.Screen.Width - 455, C.Screen.Height - 95), false);
            play.LoadContent("char edit", "19", "20", "19");

            head1 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 400),false);
            head1.LoadContent("char edit", "23");

            head2 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 400),false);
            head2.LoadContent("char edit", "24");

            head3 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 400), false);
            head3.LoadContent("char edit", "25");

            head4 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 400), false);
            head4.LoadContent("char edit", "26");

            head5 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 400), false);
            head5.LoadContent("char edit", "27");

            head6 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 400), false);
            head6.LoadContent("char edit", "28");

            body1 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 390), false);
            body1.LoadContent("char edit", "29");

            body2 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 390), false);
            body2.LoadContent("char edit", "30");

            body3 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 390), false);
            body3.LoadContent("char edit", "31");

            body4 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 390), false);
            body4.LoadContent("char edit", "32");

            body5 = new Entity(new Pos(C.Screen.Width - 750, C.Screen.Height - 390), false);
            body5.LoadContent("char edit", "33");

            arrowL1 = new Entity(new Pos(C.Screen.Width - 550, C.Screen.Height - 350), true);
            arrowL1.LoadContent("char edit", "6");

            arrowR1 = new Entity(new Pos(C.Screen.Width - 590, C.Screen.Height - 350), true);
            arrowR1.LoadContent("char edit", "5");

            arrowL =new Entity(new Pos(C.Screen.Width-550, C.Screen.Height -400),true);
            arrowL.LoadContent("char edit", "6");

            arrowR = new Entity(new Pos(C.Screen.Width - 590, C.Screen.Height - 400),true);
            arrowR.LoadContent("char edit", "5");

            role1 = new Entity(new Pos(C.Screen.Width - 550, C.Screen.Height - 400),false);
            role1.LoadContent("char edit", "13", "14", "14");

            role2 = new Entity(new Pos(C.Screen.Width - 550, C.Screen.Height - 300),false);
            role2.LoadContent("char edit", "15", "16", "16");
        }
Ejemplo n.º 12
0
        public override void Initialize()
        {
            Hero.Mana = 100;
            if (G.willFightBoss)
                Music.Play("boss");
            else
                Music.Play("monster");
            Cursor.SetVisibility(false);
            _hero = new Entity(new Pos(100, 400));
            _ennemy = new Ennemy(new Pos(800, 400));

            _map = new FightMap();
            _hero.LoadContent("fight", "1");
            _ennemy.LoadContent("fight", "3");
            _ennemy.Life = 10000;
            if (G.willFightBoss)
            {
                _ennemy.LoadContent("main deco/9");
                _ennemy.Life = 20000;
            }

            _background = new Entity();
            _background.LoadContent("fight/9");
            _background2 = new Entity(new Pos(0, 450));
            _background2.LoadContent("fight/9");

            _fireball = new Entity();
            _fireball.LoadContent("fight/fireball");
            _fireball.Visible = false;

            _ennemyFireball = new Entity();
            _ennemyFireball.LoadContent("fight/fireball2");
            _fireball.Visible = false;
            _ennemyFireball.Pos = new Pos(_ennemy.Pos.I, _ennemy.Pos.J - 32);
        }
Ejemplo n.º 13
0
Archivo: Main.cs Proyecto: Lyloox/Abimn
        public override void Update(GameTime gameTime)
        {
            _timeSinceMove += (float)gameTime.ElapsedGameTime.TotalSeconds;
            _timeStart += (float)gameTime.TotalGameTime.TotalSeconds;
            EntityHero = new Entity(new Pos((9 * 50), (7 * 50)));

            Cursor.SetVisibility(false);

            if (!shitIsDone || E.IsPushed(Keys.M))
            {
                shitIsDone = true;
                G.currentGame.Push(new Abimn.Game_States.Interact(1));
            }

            //Change CurrentGame
            if (E.IsPushed(Keys.Escape))
                G.currentGame.Push(new PauseMenu());

            /*if (E.IsPushed(Keys.I))
                G.currentGame.Push(new Inventory());*/

            if (_backmap.Decoration(_poshero) == 2)
            {
                G.currentGame.Push(new Fight());
                _backmap.SetCell(_poshero, new Cell(false, 1, 0));
            }

            if (Interact() == 5 && event1 == false)
            {
                G.currentGame.Push(new Abimn.Game_States.Interact(2));
                event1 = true;
            }

            if (Interact() == 5 && E.IsPushed(Keys.Space))
                G.currentGame.Push(new Abimn.Game_States.Interact(3));

            if (Interact() == 7 && E.IsPushed(Keys.Space))
                G.currentGame.Push(new Abimn.Game_States.Interact(4));

            if (Interact() == 8 && E.IsPushed(Keys.Space))
                G.currentGame.Push(new Abimn.Game_States.Interact(5));

            if (Interact() == 9 && E.IsPushed(Keys.Space))
            {
                G.willFightBoss = true;
                G.currentGame.Push(new Fight());
                G.currentGame.Push(new Abimn.Game_States.Interact(10));
            }

            //Change de map
            Travel();

            //Deplacement
            if (E.IsDown(Keys.B)) //courrir
            {
                if (_timeSinceMove > 0.002f)//règle la vitesse de défilement
                {
                    MoveHeros();
                    MoveHeros();
                    MoveHeros();
                }//Vérifie les touches de mouvements, accumulation pour course (update trop proches)

            }

            else
            {
                if (_timeSinceMove > 0.01f)//règle la vitesse de défilement
                    MoveHeros(); //Vérifie les touches de mouvements

            }
            EntityHero.LoadContent("new hero", _dir + _idhero.ToString());
            MoveTile();
        }