Ejemplo n.º 1
0
 public LandActiveBox(Land land, World world, Point size)
     : base(world, new Camera(size.X - 10, size.Y - 10, land))
 {
     border = new DrawableTexture("whiteSquare", this);
     border.size.X = size.X;
     border.size.Y = size.Y;
     border.filter = Color.Black;
     border.layer = 0.501f;
     texture.layer = 0.5f;
 }
Ejemplo n.º 2
0
 public LandActiveBox(Land land, World world, Point size)
     : base(world, new Camera(size.X - 10, size.Y - 10, land))
 {
     border        = new DrawableTexture("whiteSquare", this);
     border.size.X = size.X;
     border.size.Y = size.Y;
     border.filter = Color.Black;
     border.layer  = 0.501f;
     texture.layer = 0.5f;
 }
Ejemplo n.º 3
0
        public LandRat(Land land, int seed, Rat creature)
            : base(creature, land)
        {
            Random rdm = new Random(seed);

            texture = new DrawableTexture("whiteSquare", this);
            texture.size = new Vector2(10f, 10f);
            texture.filter = Color.Black;
            texture.rotation = (float)(rdm.NextDouble() * Math.PI * 2f);
        }
Ejemplo n.º 4
0
 public Town(Land land, int ID)
     : base(land)
 {
     this.ID        = ID;
     texture        = new DrawableTexture("whiteSquare", this);
     texture.filter = Color.Orange;
     texture.layer  = 0.95f;
     label          = new DrawableText(AssetManager.getAssetSpriteFont("townLabelFont"), this, "Town " + ID, Color.White);
     label.layer    = 0.949f;
 }
Ejemplo n.º 5
0
        public MapPreviewer(World world, Land land, Vector2 size)
            : base(world)
        {
            Texture2D textureBase = land.getMinimap(new Point((int)size.X, (int)size.Y));

            AssetTexture text = new AssetTexture(textureBase, "minimapTexture");

            minimap      = new DrawableTexture(text, this);
            minimap.size = size;
        }
Ejemplo n.º 6
0
 public Town(Land land, int ID)
     : base(land)
 {
     this.ID = ID;
     texture = new DrawableTexture("whiteSquare", this);
     texture.filter = Color.Orange;
     texture.layer = 0.95f;
     label = new DrawableText(AssetManager.getAssetSpriteFont("townLabelFont"), this, "Town " + ID, Color.White);
     label.layer = 0.949f;
 }
Ejemplo n.º 7
0
        public MapPreviewer(World world, Land land, Vector2 size)
            : base(world)
        {
            Texture2D textureBase = land.getMinimap(new Point((int)size.X,(int)size.Y));

            AssetTexture text = new AssetTexture(textureBase, "minimapTexture");

            minimap = new DrawableTexture(text, this);
            minimap.size = size;
        }
Ejemplo n.º 8
0
        public LandRat(Land land, int seed, Rat creature)
            : base(creature, land)
        {
            Random rdm = new Random(seed);

            texture          = new DrawableTexture("whiteSquare", this);
            texture.size     = new Vector2(10f, 10f);
            texture.filter   = Color.Black;
            texture.rotation = (float)(rdm.NextDouble() * Math.PI * 2f);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// A constructor which takes the world the ActiveBox will be displayed in plus Camera specifications.
 /// </summary>
 /// <param name="activeBoxWorld">The world the ActiveBox will be displayed in.</param>
 /// <param name="targetWorld">The world the camera displayed will draw.</param>
 /// <param name="cameraWidth">The width of the backbuffer of the camera.</param>
 /// <param name="cameraHeight">The heifht of the backbuffer of the camera.</param>
 public ActiveBox(World activeBoxWorld, World targetWorld, int cameraWidth, int cameraHeight)
     : base(activeBoxWorld)
 {
     currentID++;
     ID = currentID;
     reDrawing = true;
     this.camera = new Camera(cameraWidth, cameraHeight, targetWorld);
     AssetTexture textureAsset = AssetManager.CreateAssetTexture("ActiveBoxText" + ID, camera.backbuffer);
     texture = new DrawableTexture(textureAsset, this);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// A constructor which takes the world the ActiveBox will be displayed in and the Camera which will be displayed.
 /// </summary>
 /// <param name="world">The world the ActiveBox is going to be displayed im.</param>
 /// <param name="camera">The camera the ActiveBox will display the texture of.</param>
 public ActiveBox(World world, Camera camera)
     : base(world)
 {
     currentID++;
     ID = currentID;
     this.camera = camera;
     this.reDrawing = true;
     AssetTexture textureAsset = AssetManager.CreateAssetTexture("ActiveBoxText" + ID, camera.backbuffer);
     texture = new DrawableTexture(textureAsset , this);
 }
Ejemplo n.º 11
0
        public LandManager(GameManager gameManager)
            : base(gameManager.world)
        {
            state = LandManagerState.idle;
            this.gameManager = gameManager;

            background = new DrawableTexture("whiteSquare", this);
            background.size = UserInterfaceManager.getDiagonalOnWorld();
            background.filter = Color.Black;
            background.layer = 1f;
        }
Ejemplo n.º 12
0
        public LandManager(GameManager gameManager)
            : base(gameManager.world)
        {
            state            = LandManagerState.idle;
            this.gameManager = gameManager;

            background        = new DrawableTexture("whiteSquare", this);
            background.size   = UserInterfaceManager.getDiagonalOnWorld();
            background.filter = Color.Black;
            background.layer  = 1f;
        }
Ejemplo n.º 13
0
        /// <summary>
        /// A constructor which takes the world the ActiveBox will be displayed in plus Camera specifications.
        /// </summary>
        /// <param name="activeBoxWorld">The world the ActiveBox will be displayed in.</param>
        /// <param name="targetWorld">The world the camera displayed will draw.</param>
        /// <param name="cameraWidth">The width of the backbuffer of the camera.</param>
        /// <param name="cameraHeight">The heifht of the backbuffer of the camera.</param>
        public ActiveBox(World activeBoxWorld, World targetWorld, int cameraWidth, int cameraHeight)
            : base(activeBoxWorld)
        {
            currentID++;
            ID          = currentID;
            reDrawing   = true;
            this.camera = new Camera(cameraWidth, cameraHeight, targetWorld);
            AssetTexture textureAsset = AssetManager.CreateAssetTexture("ActiveBoxText" + ID, camera.backbuffer);

            texture = new DrawableTexture(textureAsset, this);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// A constructor which takes the world the ActiveBox will be displayed in and the Camera which will be displayed.
        /// </summary>
        /// <param name="world">The world the ActiveBox is going to be displayed im.</param>
        /// <param name="camera">The camera the ActiveBox will display the texture of.</param>
        public ActiveBox(World world, Camera camera)
            : base(world)
        {
            currentID++;
            ID             = currentID;
            this.camera    = camera;
            this.reDrawing = true;
            AssetTexture textureAsset = AssetManager.CreateAssetTexture("ActiveBoxText" + ID, camera.backbuffer);

            texture = new DrawableTexture(textureAsset, this);
        }
Ejemplo n.º 15
0
        public LandLoadPreviewer(World world, Land loadingLand)
            : base(world)
        {
            this.loadingLand = loadingLand;

            AssetSpriteFont font = AssetManager.CreateAssetSpriteFont("landLoaderFont", "defaultFont");
            statusText = new DrawableText(font, this, "", Color.White);

            statusBar = new DrawableTexture("whiteSquare", this);
            statusBar.size = new Vector2(20f, 10f);
            statusBar.position = new Vector2(0f, 30f);
        }
Ejemplo n.º 16
0
        public LandLoadPreviewer(World world, Land loadingLand)
            : base(world)
        {
            this.loadingLand = loadingLand;

            AssetSpriteFont font = AssetManager.CreateAssetSpriteFont("landLoaderFont", "defaultFont");

            statusText = new DrawableText(font, this, "", Color.White);

            statusBar          = new DrawableTexture("whiteSquare", this);
            statusBar.size     = new Vector2(20f, 10f);
            statusBar.position = new Vector2(0f, 30f);
        }
Ejemplo n.º 17
0
        public Encounter(LandCreature anchor, Land land)
            : base(land)
        {
            this.anchor = anchor;

            physicalProperties = new LandPhysicalProperties();
            physicalProperties.activelyColliding = true;
            physicalProperties.collisionType = LandCollisionTypes.Static;
            physicalProperties.radius = encounterRadius;

            Dummy = new DrawableTexture("whiteCircle100x100", this);
            Dummy.size = new Vector2(100f, 100f);
            Dummy.filter = Color.Transparent;
            Dummy.layer = 0.98f;
        }
Ejemplo n.º 18
0
        public LandHumanPlayer(Land world, HumanPlayer human, GameManager gameManager)
            : base(world, human)
        {
            this.gameManager = gameManager;
            guy        = new DrawableTexture("whiteSquare", this);
            guy.size.X = 10f;
            guy.size.Y = 10f;

            encounterTrigger.encounterHandlers += CreatureEncountered;

            physicalProperties = new LandPhysicalProperties();
            physicalProperties.activelyColliding = true;
            physicalProperties.radius            = 10f;
            physicalProperties.collisionType     = LandCollisionTypes.Solid;
        }
Ejemplo n.º 19
0
        public LandHumanPlayer(Land world, HumanPlayer human, GameManager gameManager)
            : base(world,human)
        {
            this.gameManager = gameManager;
            guy = new DrawableTexture("whiteSquare", this);
            guy.size.X = 10f;
            guy.size.Y = 10f;

            encounterTrigger.encounterHandlers += CreatureEncountered;

            physicalProperties = new LandPhysicalProperties();
            physicalProperties.activelyColliding = true;
            physicalProperties.radius = 10f;
            physicalProperties.collisionType = LandCollisionTypes.Solid;
        }
Ejemplo n.º 20
0
        public Encounter(LandCreature anchor, Land land)
            : base(land)
        {
            this.anchor = anchor;

            physicalProperties = new LandPhysicalProperties();
            physicalProperties.activelyColliding = true;
            physicalProperties.collisionType     = LandCollisionTypes.Static;
            physicalProperties.radius            = encounterRadius;

            Dummy        = new DrawableTexture("whiteCircle100x100", this);
            Dummy.size   = new Vector2(100f, 100f);
            Dummy.filter = Color.Transparent;
            Dummy.layer  = 0.98f;
        }
Ejemplo n.º 21
0
        public TerrainTile(TerrainType type, Vector2 position, Vector2 size, Land land, int seed)
            : base(land)
        {
            this.position = position;
            this.land     = land;
            this.seed     = seed;

            terrainTexture = AssetManager.getAssetTexture("whiteSquare").createAssetCopy("terrain");
            texture        = new DrawableTexture(terrainTexture, this);
            texture.size   = size;
            texture.layer  = 1f;
            this.size      = size;

            textureLoaded  = false;
            loadingTexture = false;
        }
Ejemplo n.º 22
0
            public MainMenu(GameManager manager)
                : base(manager.world)
            {
                this.manager = manager;

                entries.Add(new QuitGame(manager));
                entries.Add(new StartGame(manager));

                entries[0].position = new Vector2(0, 100);
                entries[1].position = new Vector2(0, -100);

                background        = new DrawableTexture("whiteSquare", this);
                background.size   = UserInterfaceManager.getDiagonalOnWorld();
                background.filter = Color.Black;
                background.layer  = 1f;
            }
Ejemplo n.º 23
0
        public TerrainTile(TerrainType type, Vector2 position, Vector2 size, Land land, int seed)
            : base(land)
        {
            this.position = position;
            this.land = land;
            this.seed = seed;

            terrainTexture = AssetManager.getAssetTexture("whiteSquare").createAssetCopy("terrain");
            texture = new DrawableTexture(terrainTexture , this);
            texture.size = size;
            texture.layer = 1f;
            this.size = size;

            textureLoaded = false;
            loadingTexture = false;
        }
Ejemplo n.º 24
0
        public Mountain(int seed, Land world, float radius)
            : base(world)
        {
            this.seed = seed;
            assetTexture = AssetManager.getAssetTexture("whiteSquare").createAssetCopy("mountainTexture");
            texture = new DrawableTexture(assetTexture, this);

            Random rdm = new Random(seed);
            texture.rotation = (float)rdm.NextDouble() * (float)Math.PI * 2f;
            this.radius = radius;
            //radius = MathHelper.Clamp(MathHelper.getNextNormalDistributedFloat(3f, 1f, rdm) * 50f, 30f, 500f);

            texture.size = new Vector2(radius*2f, radius*2f);
            texture.layer = 0.07f;
            textureLoaded = false;
            loadingTexture = false;
        }
Ejemplo n.º 25
0
        public Mountain(int seed, Land world, float radius)
            : base(world)
        {
            this.seed    = seed;
            assetTexture = AssetManager.getAssetTexture("whiteSquare").createAssetCopy("mountainTexture");
            texture      = new DrawableTexture(assetTexture, this);

            Random rdm = new Random(seed);

            texture.rotation = (float)rdm.NextDouble() * (float)Math.PI * 2f;
            this.radius      = radius;
            //radius = MathHelper.Clamp(MathHelper.getNextNormalDistributedFloat(3f, 1f, rdm) * 50f, 30f, 500f);

            texture.size   = new Vector2(radius * 2f, radius * 2f);
            texture.layer  = 0.07f;
            textureLoaded  = false;
            loadingTexture = false;
        }
Ejemplo n.º 26
0
        public Tree(int seed,  float radius, Land world)
            : base(world)
        {
            Random rdm = new Random(seed);
            drawTexture = new DrawableTexture(world.getTextureForTree(radius),this);
            //texture.filter = Color.ForestGreen;
            drawTexture.size = Vector2.One * radius*2f;
            drawTexture.layer = 0.05f;
            drawTexture.rotation = (float)rdm.NextDouble() * 2f * (float)Math.PI;
            this.radius = radius;
            oscilation += (float)rdm.NextDouble()*(float)Math.PI*2f;

            shadowTexture = new DrawableTexture(world.getTextureForTree(radius), this);
            shadowTexture.size = Vector2.One * radius * 2f * 1.1f;
            shadowTexture.layer = 0.1f;
            shadowTexture.rotation = drawTexture.rotation;
            shadowTexture.filter = Color.Lerp(Color.Transparent,Color.Black, 0.9f);

            physicalProperties = new LandPhysicalProperties();
            physicalProperties.activelyColliding = false;
            physicalProperties.collisionType = LandCollisionTypes.Static;
            physicalProperties.radius = 2f;
        }
Ejemplo n.º 27
0
        public Tree(int seed, float radius, Land world)
            : base(world)
        {
            Random rdm = new Random(seed);

            drawTexture = new DrawableTexture(world.getTextureForTree(radius), this);
            //texture.filter = Color.ForestGreen;
            drawTexture.size     = Vector2.One * radius * 2f;
            drawTexture.layer    = 0.05f;
            drawTexture.rotation = (float)rdm.NextDouble() * 2f * (float)Math.PI;
            this.radius          = radius;
            oscilation          += (float)rdm.NextDouble() * (float)Math.PI * 2f;

            shadowTexture          = new DrawableTexture(world.getTextureForTree(radius), this);
            shadowTexture.size     = Vector2.One * radius * 2f * 1.1f;
            shadowTexture.layer    = 0.1f;
            shadowTexture.rotation = drawTexture.rotation;
            shadowTexture.filter   = Color.Lerp(Color.Transparent, Color.Black, 0.9f);

            physicalProperties = new LandPhysicalProperties();
            physicalProperties.activelyColliding = false;
            physicalProperties.collisionType     = LandCollisionTypes.Static;
            physicalProperties.radius            = 2f;
        }
Ejemplo n.º 28
0
 public FightCreature(Creature creature, FightWorld fight)
     : base(fight)
 {
     texture        = new DrawableTexture(creature.getFightTexture(), this);
     texture.size.X = 30f;
 }
Ejemplo n.º 29
0
 public Dummy(World world, AssetTexture texture)
     : base(world)
 {
     this.texture = new DrawableTexture(texture, this);
 }
Ejemplo n.º 30
0
 public Dummy(World world, String texture)
     : base(world)
 {
     this.texture = new DrawableTexture(AssetManager.getAssetTexture(texture), this);
 }
Ejemplo n.º 31
0
 public Dummy(World world, String texture)
     : base(world)
 {
     this.texture = new DrawableTexture(AssetManager.getAssetTexture(texture), this);
 }
Ejemplo n.º 32
0
 public Dummy(World world, AssetTexture texture)
     : base(world)
 {
     this.texture = new DrawableTexture(texture, this);
 }