예제 #1
0
        protected override void LoadContent()
        {
            sprites = new LinkedList<FTexture2D>();
            spriteBatch = new SpriteBatch(GraphicsDevice);

            game_camera = new FCamera(spriteBatch, 0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height/12*9, 16, 9);
            player_one = new FActor(new Vector3(1, 1, 0));
            player_one_inventory = new FInventory(player_one);

            createTestBits();
        }
예제 #2
0
        public void createTestBits()
        {
            current_map = new FMap(20, 20);
            player_one.texture_index = 0;
            player_one.max_hit_points = 50;
            player_one.hit_points = 50;

            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("grass"), 64, 64, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("darkwood"), 64, 64, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("wood"), 64, 64, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("dirt"), 64, 64, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("invstone"), 64, 64, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("ItemCase"), 64, 64, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("Item_fireflask"), 64, 64, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("Item_frostflask"), 64, 64, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("frost_effect"), 64, 64, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("healthbottle_back"), 128, 192, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("healthbottle_front"), 128, 192, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("healthbottle_liquid"), 128, 192, 0, 0));
            sprites.AddLast(new FTexture2D(Content.Load<Texture2D>("tree"), 128, 192, 0, 0));

            inv_camera = new FCamera(spriteBatch, 0, graphics.GraphicsDevice.Viewport.Height / 12 * 9, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height / 12 * 3, 16, 3);
            inv_tiles = new FTile[16, 3];
            for (int x = 0; x < 16; x++)
            {
                for(int y = 0; y < 3; y++)
                {
                    inv_tiles[x, y] = new FTile(2, false);
                }
            }
            inv_tiles[9, 1].setSpriteIndex(5);
            inv_tiles[11, 1].setSpriteIndex(5);
            inv_tiles[10, 0].setSpriteIndex(5);
            inv_tiles[10, 2].setSpriteIndex(5);

            inventory = new FInventory(player_one);
            inventory.bag[0] = new FItem(6);
            inventory.bag[1] = new FItem(7);
            inventory.bag_item_selected = 0;
            inventory.setSlot(0) ;
            inventory.bag_item_selected = 1;
            inventory.setSlot(1);
        }