public MapLayer(ConquestMap Map, BinaryReader BR) { this.Map = Map; ListSubLayer = new List <SubMapLayer>(); StartupDelay = BR.ReadInt32(); ToggleDelayOn = BR.ReadInt32(); ToggleDelayOff = BR.ReadInt32(); Depth = BR.ReadSingle(); if (StartupDelay == 0) { IsVisible = true; ToggleTimer = ToggleDelayOn; } else { IsVisible = false; ToggleTimer = StartupDelay; } ArrayTerrain = new TerrainConquest[Map.MapSize.X, Map.MapSize.Y]; for (int Y = 0; Y < Map.MapSize.Y; Y++) { for (int X = 0; X < Map.MapSize.X; X++) { ArrayTerrain[X, Y] = new TerrainConquest(BR, X, Y); } } LayerGrid = new ConquestMap2D(Map, BR); }
public MapLayer(WorldMap Map, List <AnimationBackground> ListBackgrounds, List <AnimationBackground> ListForegrounds, BinaryReader BR) { this.Map = Map; ListSubLayer = new List <SubMapLayer>(); StartupDelay = BR.ReadInt32(); ToggleDelayOn = BR.ReadInt32(); ToggleDelayOff = BR.ReadInt32(); Depth = BR.ReadSingle(); if (StartupDelay == 0) { IsVisible = true; ToggleTimer = ToggleDelayOn; } else { IsVisible = false; ToggleTimer = StartupDelay; } ArrayTerrain = new Terrain[Map.MapSize.X, Map.MapSize.Y]; for (int Y = 0; Y < Map.MapSize.Y; Y++) { for (int X = 0; X < Map.MapSize.X; X++) { ArrayTerrain[X, Y] = new Terrain(BR, X, Y); } } LayerGrid = OriginalLayerGrid = new WorldMap2D(Map, ListBackgrounds, ListForegrounds, BR); }
public MapLayer(SorcererStreetMap Map, List <AnimationBackground> ListBackgrounds, List <AnimationBackground> ListForegrounds, BinaryReader BR) { this.Map = Map; ListSubLayer = new List <SubMapLayer>(); StartupDelay = BR.ReadInt32(); ToggleDelayOn = BR.ReadInt32(); ToggleDelayOff = BR.ReadInt32(); Depth = BR.ReadSingle(); if (StartupDelay == 0) { IsVisible = true; ToggleTimer = ToggleDelayOn; } else { IsVisible = false; ToggleTimer = StartupDelay; } ArrayTerrain = new TerrainSorcererStreet[Map.MapSize.X, Map.MapSize.Y]; for (int Y = 0; Y < Map.MapSize.Y; Y++) { for (int X = 0; X < Map.MapSize.X; X++) { int TerrainTypeIndex = BR.ReadInt32(); switch (Map.ListTerrainType[TerrainTypeIndex]) { case TerrainSorcererStreet.FireElement: case TerrainSorcererStreet.WaterElement: case TerrainSorcererStreet.EarthElement: case TerrainSorcererStreet.AirElement: ArrayTerrain[X, Y] = new ElementalTerrain(X, Y, TerrainTypeIndex); break; case TerrainSorcererStreet.EastGate: case TerrainSorcererStreet.WestGate: case TerrainSorcererStreet.SouthGate: case TerrainSorcererStreet.NorthGate: ArrayTerrain[X, Y] = new GateTerrain(X, Y, TerrainTypeIndex); break; default: ArrayTerrain[X, Y] = new TerrainSorcererStreet(X, Y, TerrainTypeIndex); break; } } } OriginalLayerGrid = new SorcererStreetMap2D(Map, BR); LayerGrid = new Map3D(Map, this, OriginalLayerGrid, GameScreen.GraphicsDevice); }
public override void Load() { base.Load(); LoadMap(); LoadMapAssets(); MapGrid = new WorldMap2D(this, ListBackgrounds, ListForegrounds); sprWaypoint = Content.Load<Texture2D>("Maps/World Maps/Constructions/Humans/Unit Factory/Waypoint"); Player NewPlayer = new Player("Player", "Human", true, 0, Factions.Humans, Color.Blue); LoadFactionPlayerHumans(NewPlayer); ListPlayer.Add(NewPlayer); TogglePreview(true); }
public MapLayer(WorldMap Map, List <AnimationBackground> ListBackgrounds, List <AnimationBackground> ListForegrounds) { this.Map = Map; ListSubLayer = new List <SubMapLayer>(); ToggleTimer = StartupDelay; IsVisible = StartupDelay > 0; //Tiles ArrayTerrain = new Terrain[Map.MapSize.X, Map.MapSize.Y]; for (int Y = 0; Y < Map.MapSize.Y; Y++) { for (int X = 0; X < Map.MapSize.X; X++) { ArrayTerrain[X, Y] = new Terrain(X, Y); } } LayerGrid = new WorldMap2D(Map, ListBackgrounds, ListForegrounds); }
public MapLayer(DeathmatchMap Map, List <AnimationBackground> ListBackgrounds, List <AnimationBackground> ListForegrounds) { this.Map = Map; ListSubLayer = new List <SubMapLayer>(); IsVisible = true; //Tiles ArrayTerrain = new Terrain[Map.MapSize.X, Map.MapSize.Y]; for (int Y = 0; Y < Map.MapSize.Y; Y++) { for (int X = 0; X < Map.MapSize.X; X++) { ArrayTerrain[X, Y] = new Terrain(X, Y); } } LayerGrid = OriginalLayerGrid = new DeathmatchMap2D(Map, ListBackgrounds, ListForegrounds); _Depth = OriginalLayerGrid.Depth; }
public MapLayer(ConquestMap Map) { this.Map = Map; ListSubLayer = new List <SubMapLayer>(); ToggleTimer = StartupDelay; IsVisible = StartupDelay > 0; //Tiles ArrayTerrain = new TerrainConquest[Map.MapSize.X, Map.MapSize.Y]; for (int Y = 0; Y < Map.MapSize.Y; Y++) { for (int X = 0; X < Map.MapSize.X; X++) { ArrayTerrain[X, Y] = new TerrainConquest(X, Y); } } LayerGrid = new ConquestMap2D(Map); }
public MapLayer(SorcererStreetMap Map) { this.Map = Map; ListSubLayer = new List <SubMapLayer>(); ToggleTimer = StartupDelay; IsVisible = StartupDelay > 0; //Tiles ArrayTerrain = new TerrainSorcererStreet[Map.MapSize.X, Map.MapSize.Y]; for (int Y = 0; Y < Map.MapSize.Y; Y++) { for (int X = 0; X < Map.MapSize.X; X++) { ArrayTerrain[X, Y] = new TerrainSorcererStreet(X, Y); } } OriginalLayerGrid = new SorcererStreetMap2D(Map); LayerGrid = new Map3D(Map, this, OriginalLayerGrid, GameScreen.GraphicsDevice); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(InputState input) { grid = new DrawableGrid(3); landscape = new Landscape(); effectSprites = new List<EffectSprite>(); //for (int i = 0; i < Main.backgroundLoops.Count; i++) //Main.backgroundLoops[i].Play(); scoreText = new IconText("", Main.sprites["points"], new Vector2(Main.windowSize.X / 10.0f, Main.windowSize.X / 10.0f), new Vector2(Main.windowSize.X / 6.0f, Main.windowSize.X / 12.0f), 0.5f, Color.Goldenrod, TextAlignment.Right); snake = new Snake(grid, Main.windowSize * 0.5f, this.snakeSpeed, this.startSnakeLength); landscape.AddComponent(snake); List<Type> snakeConditions = new List<Type>(); snakeConditions.Add(typeof(Mouse)); snakeConditions.Add(typeof(Rabbit)); snake.ScheduleCollisionHandling(snakeConditions); animals = new List<IDrawableGridAsset>(); for (int i = 0; i < 5; i++) this.PlaceAnimal(); ScreenManager.Game.ResetElapsedTime(); base.Activate(input); }
private Stopwatch sw = new Stopwatch(); // for dev only protected GridBaseDrawer(GridModel model, GridStatus status, ButtonBaseDrawer drawer) { grid = new DrawableGrid(model, status); this.drawer = drawer; }
/// <summary> /// Load graphics content for the game. /// </summary> /// public override void Activate(InputState input) { grid = new DrawableGrid(3); landscape = new Landscape(); effectSprites = new List<EffectSprite>(); //for (int i = 0; i < Main.backgroundLoops.Count; i++) //Main.backgroundLoops[i].Play(); scoreText = new IconText("", Main.sprites["points"], new Vector2(Main.windowSize.X / 15.0f, Main.windowSize.X / 15.0f), new Vector2(Main.windowSize.X / 6.0f, 100.0f), 0.5f, Color.Goldenrod, TextAlignment.Right); quadrantTarget = Main.numGenerator.Next() % 4 + 1; if (currentExcercise == QuadrantExcercises.PolarityOne || currentExcercise == QuadrantExcercises.PolarityTwo) quadrantCommand = new IconText(Utilities.QuadrantToPolarity(quadrantTarget), Main.sprites["quadrant"], new Vector2(Main.windowSize.X / 10.0f, Main.windowSize.X / 10.0f), new Vector2(Main.windowSize.X / 3.0f, 100), 1.0f, Color.Azure, TextAlignment.Right, TextEffect.Bubble); else quadrantCommand = new IconText(quadrantTarget.ToString(), Main.sprites["quadrant"], new Vector2(Main.windowSize.X / 10.0f, Main.windowSize.X / 10.0f), new Vector2(Main.windowSize.X / 3.0f, 100), 1.0f, Color.Azure, TextAlignment.Right, TextEffect.Bubble); resultText = new Text("", new Vector2(Main.windowSize.X / 2.0f, Main.windowSize.X / 10.0f), Main.windowSize.X / 1920.0f, Color.Red, TextEffect.Fade); this.lives = 5; lifeSprites = new List<DrawableAsset<Texture2D>>(); Vector2 lifeSpriteSize = new Vector2(Main.windowSize.X / 15.0f, Main.windowSize.X / 15.0f); for (int i = 0; i < lives; i++) lifeSprites.Add(new DrawableAsset<Texture2D>(new Vector2(Main.windowSize.X - (i + 1) * lifeSpriteSize.X, lifeSpriteSize.Y), new Vector2(0, -1), lifeSpriteSize, Main.sprites["snakeBody"])); landscape.AddStain(new CoordinateSystem(coordinateType)); snake = new Snake(grid, Main.windowSize * 0.5f, this.snakeSpeed, this.startSnakeLength); landscape.AddComponent(snake); animals = new List<IDrawableGridAsset>(); for (int i = 0; i < 4; i++) this.PlaceAnimal(i + 1); List<Type> snakeConditions = new List<Type>(); snakeConditions.Add(typeof(Mouse)); snakeConditions.Add(typeof(Rabbit)); snake.ScheduleCollisionHandling(snakeConditions); //ScreenManager.Game.ResetElapsedTime(); base.Activate(input); }