예제 #1
0
파일: MapEditor.cs 프로젝트: Lyloox/Abimn
 public MapEditor(Map map, byte slot)
     : base(true)
 {
     this.map = map;
     this.slot = slot;
     this.camera = new Pos(map.Dimensions.X * C.sizeCell / 2, map.Dimensions.Y * C.sizeCell / 2);
     this.decorating = false;
     this.currBlock = 1;
 }
예제 #2
0
파일: Main.cs 프로젝트: Lyloox/Abimn
 public override void Initialize()
 {
     Music.Play("1");
     this._idmap = 3;
     this._backmap = new Map(_idmap);
     this._poshero = _backmap.StartPos;
     this._idhero = 0;
     this._dir = "right";
     this._shift = new Pos();
     this._time = 0;
     EntityHero = new Entity(new Pos((9 * 50), (7 * 50)));
     this.event1 = false;
 }
예제 #3
0
파일: Main.cs 프로젝트: Lyloox/Abimn
        /// <summary>
        /// Appelle une nouvelle map
        /// </summary>
        public void Travel()
        {
            Pos HighTile = new Pos(_poshero.X, _poshero.Y - 1);
            Pos DownTile = new Pos(_poshero.X, _poshero.Y + 1);
            if ((_backmap.Decoration(HighTile) == 4 && (E.IsPushed(Keys.Up) || E.IsPushed(Keys.Z))) || (_backmap.Decoration(DownTile) == 4 && (E.IsPushed(Keys.Down) || E.IsPushed(Keys.S))))
            {
                _idmap = 2;
                _backmap = new Map(_idmap);
                _shift = new Pos(0, 0);
                _poshero = _backmap.StartPos;
                _idhero = 0;
                G.currentGame.Push(new Abimn.Game_States.Transition());

            }

            if (((_backmap.Decoration(HighTile) == 3 && (E.IsDown(Keys.Up) || E.IsDown(Keys.Z))) || (_backmap.Decoration(DownTile) == 3 && (E.IsDown(Keys.Down) || E.IsDown(Keys.S)))) && _idmap == 2)
            {
                _idmap = 1;
                _poshero = new Pos(45, 46);
                _backmap = new Map(_idmap);
                _idhero = 0;
                _dir = "down";
                _shift = new Pos(0, 0);
                G.currentGame.Push(new Abimn.Game_States.Transition());

            }

            if (((_backmap.Decoration(HighTile) == 3 && (E.IsDown(Keys.Up) || E.IsDown(Keys.Z))) || (_backmap.Decoration(DownTile) == 3 && (E.IsDown(Keys.Down) || E.IsDown(Keys.S)))) && _idmap == 3)
            {
                _idmap = 1;
                _backmap = new Map(_idmap);
                _idhero = 0;
                _dir = "right";
                _poshero = new Pos(0, 25);
                _shift = new Pos(0, 0);
                G.currentGame.Push(new Abimn.Game_States.Transition());

            }

            if (((_backmap.Decoration(_poshero) == 6 && (E.IsDown(Keys.Up) || E.IsDown(Keys.Z))) || (_backmap.Decoration(_poshero) == 6 && (E.IsDown(Keys.Down) || E.IsDown(Keys.S)))) && _idmap == 4)
            {
                _idmap = 1;
                _backmap = new Map(_idmap);
                _idhero = 0;
                _dir = "down";
                _poshero = new Pos(39, 03);
                _shift = new Pos(0, 0);
                G.currentGame.Push(new Abimn.Game_States.Transition());

            }
            if (((_backmap.Decoration(_poshero) == 6 && (E.IsDown(Keys.Up) || E.IsDown(Keys.Z))) || (_backmap.Decoration(_poshero) == 6 && (E.IsDown(Keys.Down) || E.IsDown(Keys.S)))) && _idmap == 1  && _poshero.X < 40)
            {

                _idmap = 4;
                Music.Play("map2");
                _backmap = new Map(_idmap);
                _idhero = 0;
                _dir = "up";
                _poshero = new Pos(05, 48);
                _shift = new Pos(0, 0);
                G.currentGame.Push(new Abimn.Game_States.Transition());
            }

            /* if (((_backmap.Decoration(_poshero) == 6 && (E.IsDown(Keys.Right) || E.IsDown(Keys.D)))) && _idmap == 5  && _poshero.X>40)
             {
                 _idmap = 5;
                 _backmap = new Map(_idmap);
                 _idhero = 0;
                 _dir = "right";
                 _poshero = new Pos(01, 25);
                 _shift = new Pos(0, 0);
                 G.currentGame.Push(new Abimn.Game_States.Transition());
             }*/

            if (((_backmap.Decoration(_poshero) == 6 && (E.IsDown(Keys.Left) || E.IsDown(Keys.Q)))) && _idmap == 5)
            {
                _idmap = 1;
                _backmap = new Map(_idmap);
                _idhero = 0;
                _dir = "left";
                _poshero = new Pos(48, 25);
                _shift = new Pos(0, 0);
                G.currentGame.Push(new Abimn.Game_States.Transition());

            }
        }