Пример #1
0
        public WorldScreen(Game Game, int SizeX, int SizeY)
            : base(Game, SizeX, SizeY)
        {
            EqHud = new Window(new Rectangle(GeneralManager.HalfWidth - 175, GeneralManager.HalfHeight - 146, 350, 146), "Textures/Hud/EqBack"/*new Color(0, 0, 0, 0.4f)*/);
            Button CloseButton = new Button(new Rectangle(GeneralManager.HalfWidth, GeneralManager.HalfHeight,32, 32), "", GeneralManager.Textures["Textures/GUI/CloseButton"], Color.Gray, Color.White, null);
            EqHud.AddGUI(CloseButton);
            this.AddGUI(EqHud);

            CraftingHud = new Window(new Rectangle(GeneralManager.HalfWidth - 175 - 180, GeneralManager.HalfHeight - 146, 180, 216), "Textures/Hud/CraftingBack");
            this.AddGUI(CraftingHud);

            ArmorHud = new Window(new Rectangle(GeneralManager.HalfWidth + 175, GeneralManager.HalfHeight - 146, 112, 180), "Textures/Hud/ArmorBack");
            this.AddGUI(ArmorHud);

            ChatHud = new Window(new Rectangle(50, GeneralManager.ScreenY - 300, 400, 300), "Textures/Hud/Chat");
            this.AddGUI(ChatHud);

            DebugHud = new Window(new Rectangle(GeneralManager.ScreenX - 400 - 50, GeneralManager.ScreenY - 300, 400, 300), "Textures/Hud/Debug");
            this.AddGUI(DebugHud);

            ExternalGUIHud = new Window(new Rectangle(GeneralManager.HalfWidth - 175, GeneralManager.HalfHeight, 350, 200), "Textures/Hud/ExternalEqBack");
            this.AddGUI(ExternalGUIHud);

            HotbarHud = new Window(new Rectangle(GeneralManager.HalfWidth - 175, GeneralManager.ScreenY - 44, 350, 44), "Textures/Hud/HotbarBack");
            this.AddGUI(HotbarHud);

            HpBar = new Window(new Rectangle(0, GeneralManager.ScreenY - 400, 50, 400), "Textures/Hud/HpBar");
            this.AddGUI(HpBar);

            ManaBar = new Window(new Rectangle(GeneralManager.ScreenX - 50, GeneralManager.ScreenY - 400, 50, 400), "Textures/Hud/ManaBar");
            this.AddGUI(ManaBar);

            MinimapHud = new Window(new Rectangle(GeneralManager.ScreenX - 300, 0, 300, 300), "Textures/Hud/MinimapBack");
            this.AddGUI(MinimapHud);

            TooltipHud = new Window(new Rectangle(GeneralManager.HalfWidth - 100,0, 200, 50), "Textures/Hud/Tooltip");
            this.AddGUI(TooltipHud);

            World = new GameWorld(this);

            foreach (BaseMod Mod in SteamAge.Mods)
            {
                Mod.Initalize(World);
            }

            Debug = new FarseerPhysics.DebugViews.DebugViewXNA(World.PhysicalWorld);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.Shape);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.AABB);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.PerformanceGraph);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.Joint);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.ContactPoints);
            Debug.DefaultShapeColor = Color.White;
            Debug.SleepingShapeColor = Color.LightGray;
            Debug.LoadContent(Parent.GraphicsDevice, Parent.Content);

            World.PostInit();
        }
Пример #2
0
 public override void Initalize(GameWorld World)
 {
     StoneBlock StoneBlock = new StoneBlock();
     GrassBlock GrassBlock = new GrassBlock();
     WoodBlock WoodBlock = new WoodBlock();
     Block.RegisterBlock(StoneBlock);
     Block.RegisterBlock(GrassBlock);
     Block.RegisterBlock(WoodBlock);
 }
Пример #3
0
 public DynamicBody(GameWorld World, Shape Shape, Vector2 Position, string TexName)
     : base(World)
 {
     Body BodyDec;
     BodyDec = new Body(World.PhysicalWorld);
     BodyDec.BodyType = BodyType.Dynamic;
     BodyFixture = BodyDec.CreateFixture(Shape);
     BodyFixture.Body.Position = Position;
     Texture = GeneralManager.Textures[TexName];
 }
Пример #4
0
        public FurnaceTE(GameWorld World)
            : base(World, "Furnace")
        {
            this.Entity = new FurnaceEntity(World);
            this.TileBlock = Block.GetBlock(1003);
            this.Name = "Textures/TileEntities/Furnace";

            MultiBlock = new MultiBlockDef(new Vector2(2, 2), Vector2.One);
            MultiBlock.SetBlock(0, 0, Block.GetBlock(1003));
            MultiBlock.SetBlock(0, 1, Block.GetBlock(1003));
            MultiBlock.SetBlock(1, 0, Block.GetBlock(1003));
            MultiBlock.SetBlock(1, 1, Block.GetBlock(1003));
        }
Пример #5
0
        public Chunk(GameWorld World, Vector2 Pos)
        {
            this.Position = Pos;
            for (int y = 0; y < GameWorld.ChunkSize; y++)
            {
                for (int x = 0; x < GameWorld.ChunkSize; x++)
                {
                    Blocks[x,y] = Block.GetBlock(2);
                    BackgroundBlocks[x, y] = (Position.Y < 0 )? Block.GetBlock(0) : Block.GetBlock(2);

                }
            }
            this.World = World;
            BlockState = new int[GameWorld.ChunkSize, GameWorld.ChunkSize];
            BackgroundBlockState = new int[GameWorld.ChunkSize, GameWorld.ChunkSize];
        }
Пример #6
0
        public Player(GameWorld World, bool IsCurrent)
        {
            Position = new Vector2(100, - 1050);
            PlayerChar = new Character(Position, World);
            this.World = World;
            PlayerChar.LoadContent(GeneralManager.Content, GeneralManager.GDevice);

            PlayerInv = new ItemSlot[40];
            PlayerHotbar = new ItemSlot[10];

            this.IsCurrentPlayer = IsCurrent;

            if (IsCurrentPlayer)
            {
                for (int y = 0; y < 4; y++)
                {
                    for (int x = 0; x < 10; x++)
                    {
                        PlayerInv[y * 10 + x] = new ItemSlot(World);
                        PlayerInv[y * 10 + x].Position = new Rectangle(x * (32 + 2) + 5 + GeneralManager.HalfWidth - 175, y * (32 + 2) + 5 +  GeneralManager.HalfHeight - 146,32,32);//GeneralManager.GetPartialRect(0.3f + x * 0.04f, 0.3f + y * 0.04f, 0.037f,0.037f);
                        PlayerInv[y * 10 + x].Visible = true;
                        World.ParentScreen.EqHud.AddGUI(PlayerInv[y * 10 + x]);
                    }
                }

                for (int x = 0; x < 10; x++)
                {
                    PlayerHotbar[x] = new ItemSlot(World);
                    PlayerHotbar[x].Position = new Rectangle(GeneralManager.HalfWidth - 175+ 5 + x * 34, GeneralManager.ScreenY - 44 + 5 ,32,32);
                    PlayerHotbar[x].Visible = true;
                    World.ParentScreen.AddGUI(PlayerHotbar[x]);
                }
            }

            PlayerInv[0].ItemStack = new ItemStack(Block.GetBlock(1), 12);
        }
Пример #7
0
        private static void RegisterRecipes(GameWorld World)
        {
            Crafting.CraftingRecipe TestRecipe = new Crafting.CraftingRecipe(World);
            TestRecipe.Output = new ItemStack(Block.GetBlock(1000), 1);

            Crafting.CraftingRecipePart CRP1 = new Crafting.CraftingRecipePart();
            CRP1.AddPart(new ItemStack(Block.GetBlock(1), 1));
            TestRecipe.RecipeParts[0, 0] = CRP1;

            Crafting.CraftingRecipePart CRP2 = new Crafting.CraftingRecipePart();
            CRP2.AddPart(new ItemStack(Block.GetBlock(1), 1));
            TestRecipe.RecipeParts[0, 1] = CRP2;

            Crafting.CraftingRecipe.RegisterRecipe(TestRecipe);
        }
Пример #8
0
 public Character(Vector2 spawnPosition, GameWorld World)
 {
     Position = spawnPosition;
     this.World = World;
 }
Пример #9
0
 public CaveGenerator(GameWorld World)
     : base(World)
 {
 }
Пример #10
0
 public override void Initalize(GameWorld World)
 {
     World.Generator.RegisterGenerator(new CaveGenerator(World));
     World.Generator.RegisterGenerator(new TreeGenerator(World));
 }
Пример #11
0
 public FurnaceEntity(GameWorld World)
     : base(World)
 {
 }
Пример #12
0
 public ItemSlot(GameWorld World)
     : base()
 {
     this.World = World;
 }
Пример #13
0
 public override void Initalize(GameWorld World)
 {
 }
Пример #14
0
 public TileEntity(GameWorld GameWorld, string Name)
     : base()
 {
     this.Name = Name;
     this.World = GameWorld;
 }
Пример #15
0
 public TreeGenerator(GameWorld World)
     : base(World)
 {
 }
Пример #16
0
 public abstract void Initalize(GameWorld World);
Пример #17
0
 public TileEntity GetNewTE(GameWorld World, Vector2 BlockPos)
 {
     return new FurnaceTE(World);
 }
Пример #18
0
 public WorldGenerator(GameWorld World)
 {
     _world = World;
     Generators = new List<Generator>();
 }
Пример #19
0
 public Generator(GameWorld World)
 {
     this.World = World;
 }
Пример #20
0
 public Entity(GameWorld World)
 {
     this.World = World;
 }