Exemple #1
0
 public Hero(ObjectArrangementIn3D heroArrangement)
 {
     ArrangeObjectOnScene(heroArrangement);
     CurrentPlatformPosition = 2;
 }
Exemple #2
0
 public Platform(ObjectArrangementIn3D platformArrangement)
     : base()
 {
     base.ArrangeObjectOnScene(platformArrangement);
     //Mesh = Content.Load<Model>("Models\\platforma");
 }
Exemple #3
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;
            graphics.IsFullScreen = false;
            IsMouseVisible = true;
            graphics.ApplyChanges();

            cameraPosition = new Vector3(0.0f, 5.0f, 10.0f);
            moveOnlyOnceRight = true;
            moveOnlyOnceLeft = true;
            mainMenu = new MainMenu(graphics);

            platformList = new List<Platform>();
            platformGenerator=new PlatformCollection();
            var heroArrangement = new ObjectArrangementIn3D
                                      {
                                          Position = new Vector3(0.0f, 0.5f, 9.0f),
                                          Scale = new Vector3(0.5f, 0.5f, 0.5f),
                                          Rotation = new Vector3(0.0f)
                                      };
            player = new Hero(heroArrangement);

            CreatePlatforms(PlatformCount, FirstPlatformPosition, DistanceBetweenPlatforms);

            base.Initialize();
        }
Exemple #4
0
        void CreatePlatforms(int platformCount, float firstPlatformPosition, float distanceBetweenPlatforms)
        {
            platformGenerator.UpdatePlatforms();
            rowFromGenerator = platformGenerator.GetLastAddedRowValues;

            for (int i = 0; i < platformCount; i++)
            {
                if (rowFromGenerator[i] == true)
                {
                    ObjectArrangementIn3D platformArrangement = new ObjectArrangementIn3D();
                    platformArrangement.Position = new Vector3(firstPlatformPosition + i * distanceBetweenPlatforms, 0.0f, BeginningOfBoardPositionZ);
                    platformArrangement.Scale = new Vector3(0.5f);
                    platformArrangement.Rotation = new Vector3(0.0f);
                    Platform newPlatform = new Platform(platformArrangement);
                    platformList.Add(newPlatform);
                }
            }
        }
Exemple #5
0
 protected void ArrangeObjectOnScene(ObjectArrangementIn3D objectArrangement)
 {
     ObjectArrangement = objectArrangement;
 }
Exemple #6
0
 protected Object(ObjectArrangementIn3D objectArrangement)
 {
     ArrangeObjectOnScene(objectArrangement);
 }
Exemple #7
0
 protected Object()
 {
     ObjectArrangement = new ObjectArrangementIn3D(new Vector3(0.0f), new Vector3(0.0f), new Vector3(0.0f));
 }