Ejemplo n.º 1
0
        private void CheckRecyclePlatform()
        {
            float x    = Platforms[0].BoundingBox.Center.X;
            float newX = float.MinValue;

            Platform newPlatform = null;

            if (movementDirection == MovementDirections.LEFT)
            {
                if (x <= -OFFSCREEN_DISTANCE)
                {
                    newX = x + totalLength;
                }
            }
            else
            {
                if (x >= Constants.SCREEN_WIDTH + OFFSCREEN_DISTANCE)
                {
                    newX = x - totalLength;
                }
            }

            if (newX != float.MinValue)
            {
                newPlatform = new Platform(new Vector2(newX, yValue), Hazards.HazardTypes.NONE, true);

                Platforms[0].Destroy();
                Platforms.RemoveAt(0);
                Platforms.Add(newPlatform);
                PlatformMasterList.Add(newPlatform);
            }
        }
Ejemplo n.º 2
0
        public override void LoadContent(ContentManager Content)
        {
            BackgroundTexture = Content.Load <Texture2D>("background");
            ForegroundTexture = Content.Load <Texture2D>("Level_Classic_Foreground");

            // Platforms
            Platform platform1 = new Platform(PlatformTexture, new Vector2((Game1.GAME_WIDTH / 2) - 300, (Game1.GAME_HEIGHT / 5) * 2 + 100), 600);

            Platforms.Add(platform1);
            Platform platform2 = new Platform(PlatformTexture, new Vector2(100, (Game1.GAME_HEIGHT / 5) * 4), Game1.GAME_WIDTH - 200);

            Platforms.Add(platform2);
            Platform platform3 = new Platform(PlatformTexture, new Vector2(50, (Game1.GAME_HEIGHT / 5) * 3), 400);

            Platforms.Add(platform3);
            Platform platform4 = new Platform(PlatformTexture, new Vector2(Game1.GAME_WIDTH - 450, (Game1.GAME_HEIGHT / 5) * 3), 400);

            Platforms.Add(platform4);

            // Spawns
            P1Spawn = new Vector2(0, 0);
            P2Spawn = new Vector2(0, 0);
            P3Spawn = new Vector2(0, 0);
            P4Spawn = new Vector2(0, 0);

            base.LoadContent(Content);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// creates a lua-based platform from the given filename
        /// </summary>
        /// <param name="filename">the name of the lua file to load</param>
        /// <returns>the created platform</returns>
        public Platform CreatePlatform(string filename)
        {
            Platform platform = Platform.LoadFromFile(filename, this);

            Platforms.Add(platform);
            return(platform);
        }
        public void MouseLeftButtonDown(Point pixelPosition)
        {
            pixelPosition.Y = PixelHeight - pixelPosition.Y;

            if (EditorMode == EditorMode.Select)
            {
                Platforms.Apply(p => p.IsSelected = false);
                PlatformWrapper platform = GetPlatformAtPosition(pixelPosition);
                if (platform != null)
                {
                    platform.IsSelected             = true;
                    mEditorManager.SelectedPlatform = platform;
                    mIsDragging = true;
                }
                else
                {
                    mEditorManager.SelectedPlatform = null;
                }
            }
            else if (EditorMode == EditorMode.Platform)
            {
                PlatformWrapper addedPlatform = new PlatformWrapper(new PlatformData(-1, 0.0, 0.0, PlatformType.Normal, null, null));
                SetObjectPosition(addedPlatform, pixelPosition);

                Platforms.Add(addedPlatform);
                UpdateModel();
            }
        }
Ejemplo n.º 5
0
    public static void Configure(ICakeContext context)
    {
        Context            = context;
        Configuration      = Context.Argument("configuration", "Release");
        UseXBuildOnWindows = Context.Argument("forcexbuild", false);
        var targetDir = Context.Argument <string>("targetdir", null);

        if (targetDir != null)
        {
            TargetDirectory = targetDir;
        }

        var platform = Context.Argument("platforms", Context.Argument <string>("platforms", null));

        if (platform != null)
        {
            var allPlatforms = platform.Split(';');
            foreach (var p in allPlatforms)
            {
                PlatformTarget parsed;
                if (Enum.TryParse(p, true, out parsed))
                {
                    Platforms.Add(parsed);
                }
                else
                {
                    var strings = Enum.GetNames(typeof(PlatformTarget));
                    throw new ArgumentException(
                              "Not a valid platform specifier. Valid values are " + string.Join(", ", strings) + ".",
                              "platform");
                }
            }
        }
    }
Ejemplo n.º 6
0
        private async void LoadData()
        {
            var platformService = new Services.PlatformService();
            var result          = await platformService.GetAllPlatforms();

            foreach (var plat in result.Results)
            {
                Platforms.Add(plat);
            }
        }
Ejemplo n.º 7
0
        public void Initialization(string playerName, string platformName)
        {
            LowerTrigger = LoadLowerTrigger();
            LoadPrefabs();

            Player = CreatePlayer(playerName);
            for (int i = 0; i < Constants.platformCount; i++)
            {
                Platforms.Add(CreatePlatform(platformName));
            }
        }
Ejemplo n.º 8
0
        private void AddPlatforms()
        {
            Platform lastPlatform = Platforms.Last();

            while (lastPlatform.Position.X + lastPlatform.Width < Global.ScreenWidth * 2)
            {
                Platform newPlatform = new Platform(lastPlatform);
                Platforms.Add(newPlatform);
                lastPlatform = newPlatform;
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Assign a platform as a member of the given group
        /// </summary>
        public static void RegisterPlatformWithGroup(UnrealTargetPlatform InPlatform, UnrealPlatformGroup InGroup)
        {
            // find or add the list of groups for this platform
            List <UnrealTargetPlatform> Platforms;

            if (!PlatformGroupDictionary.TryGetValue(InGroup, out Platforms))
            {
                Platforms = new List <UnrealTargetPlatform>();
                PlatformGroupDictionary.Add(InGroup, Platforms);
            }
            Platforms.Add(InPlatform);
        }
Ejemplo n.º 10
0
        public void Update(GameTime gameTime, Camera camera, bool Debug)
        {
            #region PickupHearts
            HeartElapsed += gameTime.ElapsedGameTime.TotalMilliseconds;
            if (HeartElapsed >= heartRespRate && heartCounter <= 15) //If heartElapsed reaches above 5000ms (heartRespRate), it spawns a new heart.
            {
                heart(content, platforms);
                HeartElapsed = 0;
                heartCounter++;
            }
            #endregion

            #region AddPlatforms with RMB
            if (Debug)
            {
                MouseState mouseState = Mouse.GetState();

                //Adds a new platform at the x,y of the mouse
                //Does not get saved and placed next time you start the game
                if (mouseState.RightButton == ButtonState.Pressed)
                {
                    Random rng = new Random();

                    int i = rng.Next(1, 4);

                    if (i == 1)
                    {
                        base.texture = content.Load <Texture2D>("images/Objects/platform1");
                    }
                    if (i == 2)
                    {
                        base.texture = content.Load <Texture2D>("images/Objects/platform2");
                    }
                    if (i == 3)
                    {
                        base.texture = content.Load <Texture2D>("images/Objects/platform3");
                    }

                    //Needs to be mouse position + camera position for it to be drawn in the right place, otherwise it draws it at the gamewindow coords.
                    int y = (int)mouseState.Position.Y + (int)camera.Position.Y;
                    int x = (int)mouseState.Position.X + (int)camera.Position.X;

                    hitbox = new Rectangle(x, y, texture.Width, texture.Height);
                    Platforms.Add(new Platform(texture, new Vector2(x, y), hitbox));
                }
            }

            #endregion
        }
Ejemplo n.º 11
0
        protected int GetPlatform(string _name)
        {
            DataSet ds = SqlHelper.ExecuteDataset(dsn, CommandType.Text, "SELECT * FROM cv_platforms WHERE name = '" + _name + "' AND enabled = 1 AND deleted = 0");

            if (ds.Tables[0].Rows.Count == 0)
            {
                oPlatform.Add(_name, intProfile, 0, "", "", 0, 0, 0, 0, "", "", "", "", "", "", "", "", "", "", "", 100, 0, 0, 1);
                sb.Append("<tr><td>-</td><td>Add Platform ");
                sb.Append(_name);
                sb.Append("</td></tr>");
                return(GetPlatform(_name));
            }
            else
            {
                return(Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString()));
            }
        }
Ejemplo n.º 12
0
        public GameDto(Game game)
        {
            Id          = game.Id;
            Title       = game.Title;
            Description = game.Description;
            ReleaseDate = game.ReleaseDate;

            Publisher = new PublisherDto(game.Publisher);
            Developer = new DeveloperDto(game.Developer);
            foreach (var genre in game.GameGenres)
            {
                Genres.Add(new GenreDto(genre.Genre));
            }
            foreach (var platform in game.GamePlatforms)
            {
                Platforms.Add(new PlatformDto(platform.Platform));
            }
        }
Ejemplo n.º 13
0
        public void CopyFrom(Settings settings)
        {
            // cannot overwrite the object (due to binding) so copy over the data
            MorphemeConnectPath            = settings.MorphemeConnectPath;
            RuntimeSDKRoot                 = settings.RuntimeSDKRoot;
            ExportRootPath                 = settings.ExportRootPath;
            AssetCompilerCommandLine       = settings.AssetCompilerCommandLine;
            PreProcessCommand              = settings.PreProcessCommand;
            PostProcessCommand             = settings.PostProcessCommand;
            UseDynamicAssetCompilerPlugins = settings.UseDynamicAssetCompilerPlugins;

            Platforms.Clear();

            foreach (PlatformConfiguration platform in settings.Platforms)
            {
                platform.UseDuringExport = true; // the flag to use this platform is not part of the config, default to true

                Platforms.Add(platform);
            }
        }
Ejemplo n.º 14
0
        public KordueneWorkspace(SlnFile sln) : this()
        {
            SlnFile = sln;

            var guidSection = sln.Sections.GetSection("ExtensibilityGlobals", SlnSectionType.PostProcess);
            var id          = SolutionId.CreateFromSerialized(new Guid(guidSection.Properties.GetValue("SolutionGuid")));

            var solution = this.CreateSolution(SolutionInfo.Create(id, VersionStamp.Default, sln.FullPath));

            foreach (var item in sln.Projects)
            {
                var proj = ProjectInfo.Create(ProjectId.CreateFromSerialized(new Guid(item.Id)), VersionStamp.Default, item.Name, item.Name, LanguageNames.CSharp, Path.Combine(sln.BaseDirectory, item.FilePath));
                proj     = AddProjectDocuments(proj);
                proj     = AddDefaultReferences(proj);
                solution = solution.AddProject(proj);
            }

            var configs = sln.Sections.GetSection("SolutionConfigurationPlatforms");

            Configurations.Clear();
            foreach (var item in configs.Properties)
            {
                var configPlat = item.Value.Split("|");

                if (!Configurations.Contains(configPlat[0].Replace(" ", string.Empty)))
                {
                    Configurations.Add(configPlat[0]);
                }

                if (!Platforms.Contains(configPlat[1].Replace(" ", string.Empty)))
                {
                    Platforms.Add(configPlat[1].Replace(" ", string.Empty));
                }
            }

            this.SetCurrentSolution(solution);

            LoadProjectSymbols();
        }
            ProvisioningProfile(string fileName, MobileProvision provision) : this()
            {
                FileName     = fileName;
                LastModified = File.GetLastWriteTimeUtc(fileName);

                Name           = provision.Name;
                Uuid           = provision.Uuid;
                Distribution   = provision.DistributionType;
                CreationDate   = provision.CreationDate;
                ExpirationDate = provision.ExpirationDate;

                if (provision.Platforms != null)
                {
                    for (int i = 0; i < provision.Platforms.Length; i++)
                    {
                        Platforms.Add(provision.Platforms[i]);
                    }
                }

                PString identifier;

                if (provision.Entitlements.TryGetValue("com.apple.application-identifier", out identifier))
                {
                    ApplicationIdentifier = identifier.Value;
                }
                else if (provision.Entitlements.TryGetValue("application-identifier", out identifier))
                {
                    ApplicationIdentifier = identifier.Value;
                }
                else
                {
                    ApplicationIdentifier = string.Empty;
                }

                for (int i = 0; i < provision.DeveloperCertificates.Count; i++)
                {
                    DeveloperCertificates.Add(new DeveloperCertificate(provision.DeveloperCertificates[i]));
                }
            }
Ejemplo n.º 16
0
        public GameViewModel(Game game) : this()
        {
            GameID           = game.GameID;
            GameName         = game.GameName;
            URL              = game.URL;
            CoverImageURL    = game.CoverImageURL;
            StoryLine        = game.StoreLine;
            Summary          = game.Summary;
            FirstReleaseDate = game.FirstReleaseDate;
            Published        = game.Published.HasValue ? game.Published.Value : false;

            foreach (var gameGenre in game.GameGenres)
            {
                Genres.Add(
                    new GenreViewModel(gameGenre.Genre)
                    );
            }

            foreach (var gameTheme in game.GameThemes)
            {
                Themes.Add(
                    new ThemeViewModel(gameTheme.Theme)
                    );
            }

            foreach (var gameMode in game.GameModes)
            {
                Modes.Add(
                    new ModeViewModel(gameMode.Mode)
                    );
            }

            foreach (var gamePerspective in game.GamePerspectives)
            {
                Perspectives.Add(
                    new PerspectiveViewModel(gamePerspective.Perspective)
                    );
            }

            foreach (var gameScreenshots in game.GameScreenshots)
            {
                Screenshots.Add(
                    new ScreenshotViewModel(gameScreenshots.Screenshot)
                    );
            }

            foreach (var gamePlatform in game.GamePlatforms)
            {
                Platforms.Add(
                    new PlatformViewModel(
                        gamePlatform.Platform,
                        gamePlatform.ReleaseDate.Value)
                    );

                foreach (var history in gamePlatform.VendorGameHistories)
                {
                    PriceHistory.Add(
                        new PriceHistoryViewModel(history)
                        );
                }
            }


            if (PriceHistory.Count() > 0)
            {
                TodaysPrices  = PriceHistory?.Where(ph => ph.CreatedDate >= DateTime.Today).ToList();
                Cheapest      = TodaysPrices?.GroupBy(ph => ph.Price)?.OrderBy(ph => double.Parse(ph.Key))?.FirstOrDefault()?.Select(ph => ph).ToList();
                CheapestPrice = Cheapest?.FirstOrDefault().Price;
            }

            foreach (var settings in game.GamePlatforms.Select(gp => gp.VendorGameSettings))
            {
                foreach (var setting in settings)
                {
                    Settings.Add(new VendorGameSettingViewModel(setting));
                }
            }
        }
Ejemplo n.º 17
0
 private void SetPlatform(Message m)
 {
     Platforms.Add(m.Text);
 }
Ejemplo n.º 18
0
        public async Task RefreshDataAsync()
        {
            try
            {
                using (var db = new ResultDB())
                {
                    Status = "Loading...";

                    var runs = await db.TestRuns.ToListAsync();

                    var methods = await db.TestMethods.ToListAsync();

                    var watches = await db.TestStopwatches.ToListAsync();

                    var ws =
                        (
                            from w in watches
                            group w by w.TestMethodID into g
                            select new { g.Key, Items = g.ToList() }
                        )
                        .ToDictionary(t => t.Key, t => t.Items);

                    var ms =
                        (
                            from m in methods
                            group m by m.TestRunID into g
                            select new
                    {
                        g.Key,
                        Items = g.Select(mt => new
                        {
                            Method = mt,
                            Watches = ws.ContainsKey(mt.ID) ? ws[mt.ID] : new List <TestStopwatch>()
                        }).ToList()
                    }
                        )
                        .ToDictionary(t => t.Key, t => t.Items);

                    var rs =
                        (
                            from r in runs
                            group r by new { r.Platform, r.Name } into g
                            //orderby g.Key.Platform, g.Key.Name
                            select new { g.Key, Items = g.Select(rt => new { Run = rt, Methods = ms[rt.ID] }).ToList() }
                        )
                        .ToDictionary(t => t.Key, t => t.Items);

                    var providers = ws.Values.SelectMany(w => w).Select(w => w.Provider).Distinct().OrderBy(p => p);

                    SolidColorBrush GetBrush(Color color, int delta)
                    {
                        return(new SolidColorBrush(Color.FromRgb(
                                                       (byte)Math.Min(Math.Max(color.R + delta, 0), 255),
                                                       (byte)Math.Min(Math.Max(color.G + delta, 0), 255),
                                                       (byte)Math.Min(Math.Max(color.B + delta, 0), 255))));
                    }

                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        ProviderBrushes = new Dictionary <string, Brush>
                        {
                            ["AdoNet"]   = new SolidColorBrush(Color.FromRgb(0xAA, 0x40, 0xFF)),
                            ["Dapper"]   = new SolidColorBrush(Color.FromRgb(0x63, 0x2F, 0x00)),
                            ["PetaPoco"] = new SolidColorBrush(Color.FromRgb(0xFF, 0x76, 0xBC)),

                            ["L2DB Sql"]      = GetBrush(Color.FromRgb(0x19, 0x99, 0x00), 0x1A),
                            ["L2DB Compiled"] = GetBrush(Color.FromRgb(0x19, 0x99, 0x00), 0x00),
                            ["L2DB Linq"]     = GetBrush(Color.FromRgb(0x19, 0x99, 0x00), -0x1A),

                            ["EF Core Sql"]      = GetBrush(Color.FromRgb(0xFF, 0x98, 0x1D), 0x1A),
                            ["EF Core Compiled"] = GetBrush(Color.FromRgb(0xFF, 0x98, 0x1D), 0x00),
                            ["EF Core Linq"]     = GetBrush(Color.FromRgb(0xFF, 0x98, 0x1D), -0x1A),

                            ["L2S Sql"]      = GetBrush(Color.FromRgb(0x1F, 0xAE, 0xFF), 0x1A),
                            ["L2S Compiled"] = GetBrush(Color.FromRgb(0x1F, 0xAE, 0xFF), 0x00),
                            ["L2S Linq"]     = GetBrush(Color.FromRgb(0x1F, 0xAE, 0xFF), -0x1A),

                            ["EF6 Sql"]      = GetBrush(Color.FromRgb(0xC1, 0x00, 0x4F), 0x1A),
                            ["EF6 Compiled"] = GetBrush(Color.FromRgb(0xC1, 0x00, 0x4F), 0x00),
                            ["EF6 Linq"]     = GetBrush(Color.FromRgb(0xC1, 0x00, 0x4F), -0x1A),

                            ["BLToolkit Sql"]      = GetBrush(Color.FromRgb(0x7F, 0x6E, 0x94), 0x1A),
                            ["BLToolkit Compiled"] = GetBrush(Color.FromRgb(0x7F, 0x6E, 0x94), 0x00),
                            ["BLToolkit Linq"]     = GetBrush(Color.FromRgb(0x7F, 0x6E, 0x94), -0x1A),
                        };

                        var colors = new[]
                        {
                            Color.FromRgb(0xFF, 0x2E, 0x12),
                            Color.FromRgb(0x25, 0x72, 0xEB),
                            Color.FromRgb(0x46, 0x17, 0xB4),
                            Color.FromRgb(0x72, 0x00, 0xAC),
                            Color.FromRgb(0xFE, 0x7C, 0x22),
                            Color.FromRgb(0xFF, 0x1D, 0x77),
                            Color.FromRgb(0x4F, 0x1D, 0x77),
                            Color.FromRgb(0x91, 0xD1, 0x00),
                            Color.FromRgb(0x77, 0xB9, 0x00),
                            Color.FromRgb(0x00, 0xC1, 0x3F),
                            Color.FromRgb(0xE1, 0xB7, 0x00),
                            Color.FromRgb(0xE1, 0xB7, 0xA0),
                            Color.FromRgb(0xF3, 0xB2, 0x00),
                            Color.FromRgb(0xFF, 0x98, 0x1D),
                            Color.FromRgb(0x56, 0xC5, 0xFF),
                            Color.FromRgb(0x56, 0x05, 0xFF),
                            Color.FromRgb(0x00, 0xD8, 0xCC),
                            Color.FromRgb(0x00, 0x82, 0x87),
                            Color.FromRgb(0x00, 0xA3, 0xA3),
                            Color.FromRgb(0x00, 0x6A, 0xC1),
                            Color.FromRgb(0x00, 0xA3, 0xA3),
                            Color.FromRgb(0x90, 0xA3, 0xA3),
                        };

                        var count = ProviderBrushes.Count;

                        foreach (var item in providers)
                        {
                            if (!ProviderBrushes.ContainsKey(item))
                            {
                                ProviderBrushes[item] = new SolidColorBrush(colors[ProviderBrushes.Count - count]);
                            }
                        }
                    });

                    foreach (var platform in Platforms)
                    {
                        foreach (var test in platform.Tests)
                        {
                            test.Test = null;
                        }
                    }

                    var tests = rs
                                .Select(r => new TestViewModel
                    {
                        Platform = r.Key.Platform,
                        Name     = r.Key.Name,
                        Methods  = new ObservableCollection <MethodViewModel>(
                            from rt in r.Value
                            from m  in rt.Methods
                            group new { rt, m } by new { m.Method.Name, m.Method.Repeat, m.Method.Take } into gr
                            select new MethodViewModel(
                                from t in gr
                                from w in t.m.Watches
                                group new { t, w } by w.Provider into g
                                select new TimeViewModel(g.Select(tw => tw.w))
                        {
                            Name = g.Key,
                        })
                        {
                            Name   = gr.Key.Name,
                            Repeat = gr.Key.Repeat,
                            Take   = gr.Key.Take,
                        })
                    })
                                .ToList();

                    for (var i = 0; i < tests.Count; i++)
                    {
                        var test = tests[i];
                        var idx  = Tests
                                   .Select((t, n) => new { t, n })
                                   .Where(t => t.t.Platform == test.Platform && t.t.Name == test.Name)
                                   .Select(t => (int?)t.n)
                                   .FirstOrDefault();

                        var platform = Platforms.FirstOrDefault(p => p.Name == test.Platform);

                        if (platform == null)
                        {
                            Application.Current.Dispatcher.Invoke(() => Platforms.Add(platform = new PlatformViewModel {
                                Name = test.Platform
                            }));
                        }

                        var platformTest = platform.Tests.FirstOrDefault(t => t.Name == test.Name);

                        if (platformTest == null)
                        {
                            platformTest = new PlatformTestViewModel {
                                Name = test.Name
                            };
                            Application.Current.Dispatcher.Invoke(() => platform.Tests.Add(platformTest));
                        }

                        if (idx == null)
                        {
                            platformTest.Test = test;
                            Application.Current.Dispatcher.Invoke(() => Tests.Insert(i, test));
                        }
                        else
                        {
                            if (i != idx)
                            {
                                Application.Current.Dispatcher.Invoke(() => Tests.Move(idx.Value, i));
                            }
                            platformTest.Test = Tests[i];
                            Tests[i].Merge(test);
                        }
                    }

                    foreach (var platform in Platforms.ToList())
                    {
                        foreach (var test in platform.Tests.ToList())
                        {
                            if (test.Test == null)
                            {
                                Application.Current.Dispatcher.Invoke(() => platform.Tests.Remove(test));
                            }
                        }

                        if (platform.Tests.Count == 0)
                        {
                            Application.Current.Dispatcher.Invoke(() => Platforms.Remove(platform));
                        }
                    }

                    while (Tests.Count > tests.Count)
                    {
                        Application.Current.Dispatcher.Invoke(() => Tests.RemoveAt(Tests.Count - 1));
                    }
                }
            }
            catch (Exception ex)
            {
                Application.Current.Dispatcher.Invoke(() =>
                                                      MessageBox.Show(ex.Message, "Exception", MessageBoxButton.OK, MessageBoxImage.Error));
            }

            Status = "";
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Takes the list of chars the reader has read and add the map entities
        /// to the corresponding entity containers, goes top-left to bottom-right
        /// </summary>
        /// <param name="map"></param>
        public void MapCreator(List <char> map)
        {
            const float width  = 0.025F;
            const float height = 0.04347F;
            const float xMin   = 0;
            const float yMin   = 0;
            const float xMax   = 1 - width;
            const float yMax   = 1 - height;


            Vec2F imageExtent = new Vec2F(width, height);

            var x = xMin;
            var y = yMax;

            var index = 0;

            while (y > yMin)
            {
                while (x < xMax)
                {
                    // Increment index variable when coordinate is empty
                    if (map[index].ToString() == " ")
                    {
                        index += 1;
                    }
                    else
                    {
                        if (reader.LegendData.ContainsKey(map[index]) && !reader.MetaData.ContainsKey(map[index]))
                        {
                            var shape = new StationaryShape(new Vec2F(x, y), imageExtent);
                            var file  =
                                Path.Combine(Utils.GetImageFilePath(reader.LegendData[map[index]]));
                            Obstacles.AddStationaryEntity(shape, new Image(file));
                        }

                        if (reader.MetaData.ContainsKey(map[index]))
                        {
                            var shape = new StationaryShape(new Vec2F(x, y), imageExtent);
                            var file  =
                                Path.Combine((Utils.GetImageFilePath(reader.MetaData[map[index]])));
                            Platforms.Add(new Platform(shape, new Image(file), map[index]));
                        }

                        if (map[index] == '^')
                        {
                            var shape = new StationaryShape(new Vec2F(x, y), imageExtent);
                            var file  =
                                Path.Combine(Utils.GetImageFilePath("aspargus-passage.png"));
                            Exits.AddStationaryEntity(shape, new Image(file));
                        }

                        if (map[index] == '>')
                        {
                            playerpos = new Vec2F(x, y);
                        }
                        index += 1;
                    }
                    x += width;
                }
                x  = 0;
                y -= height;
            }
        }
Ejemplo n.º 20
0
 public void AddPlatform(Platform P)
 {
     Platforms.Add(P);
 }
Ejemplo n.º 21
0
 public static void SpawnPlatform(Vector2 position)
 {
     Platforms.Add(new Platform(new Rectangle((int)position.X, (int)position.Y, Platform.Texture.Width, Platform.Texture.Height)));
 }