Exemplo n.º 1
0
 public TileEngineScreen()
     : base()
 {
     userMovement = Vector2.Zero;
     TileEngine = Session.currentSession.TileEngine;
     TileEngine.SetMap(Session.currentSession.Map, -1);
     PlayerDummy = Globals.Instance.Content.Load<Texture2D>("Player");
     random = new Random();
 }
Exemplo n.º 2
0
 public Session()
 {
     Inventory = new Inventory();
     TileEngine = new TileEngineHelper();
     Map = Globals.Instance.Content.Load<Map>("Maps\\StartLevel");
     SkillPool = Globals.Instance.Content.Load<SkillPool>("SkillPool");
     ScriptEngine.ScriptEngine.Instance.Reset();
     Party = new List<Character>();
     Party.Add(new Character("Natsu", 0, (Weapon)ItemPool.Instance.GetItem("Bare Hands"), (Armour)ItemPool.Instance.GetItem("T-Shirt")));
     Party[0].Skills.Add(SkillPool.GetSkill("AoE Attack"));
     Party[0].Skills.Add(SkillPool.GetSkill("Fire"));
     Party[0].Skills.Add(SkillPool.GetSkill("Vita"));
 }
Exemplo n.º 3
0
        public void Initialize(ContentManager Content, GraphicsDevice Graphics)
        {
            StorageDeviceResult = StorageDevice.BeginShowSelector(PlayerIndex.One, null, null);
            StorageDeviceResult.AsyncWaitHandle.WaitOne();
            StorageDevice = StorageDevice.EndShowSelector(StorageDeviceResult);
            StorageDeviceResult.AsyncWaitHandle.Close();
            OpenContainer();
            this.Content = Content;
            this.Graphics = Graphics;
            this.SpriteBatch = new SpriteBatch(Graphics);
            this.SpriteFont = Content.Load<SpriteFont>("DefaultFont");

            ScreenHeight = Graphics.Viewport.Height;
            ScreenWidth = Graphics.Viewport.Width;
            ScreenHeightHalf = ScreenHeight / 2;
            ScreenWidthHalf = ScreenWidth / 2;
            FullScreenRectangle = new Rectangle(0, 0, (int)ScreenWidth, (int)ScreenHeight);

            Random = new Random();
            PixelWhite = new Texture2D(Graphics, 1, 1);
            Color[] data = { Color.White };
            PixelWhite.SetData<Color>(data);
            int GardientSize = 1000;
            Gardient = new Texture2D(Graphics, GardientSize, GardientSize);
            data = new Color[GardientSize * GardientSize];
            for (int x = 0; x < GardientSize; x++)
            {
                for (int y = 0; y < GardientSize; y++)
                {
                    float c = 1.0f - ((float)(x * y)) / (GardientSize * GardientSize);
                    data[x + y * GardientSize] = new Color(c, c, c);
                }
            }
            MapEditor = new MapEditor.MapEditor();
            MapEditor.Show();
            TileEngine = new TileEngine.TileEngineHelper();
            Gardient.SetData<Color>(data);
            SelectedTile = 0;
        }