示例#1
0
 public void CreateLevel()
 {
     if (CheckInitialization())
     {
         _levelCreator.CreateLevel();
     }
 }
示例#2
0
        public void LevelTbCustomer()
        {
            levelCreator = new LevelCreator();
            customers    = new List <Customer>();
            levelCreator.CreateLevel("the-beach.txt");
            foreach (var customer in levelCreator.Customer)
            {
                Customer cust = new Customer(customer);
                customers.Add(cust);
            }

            Assert.True(customers[0].name == "Bob");
            Assert.True(customers[0].SpawnTime == 3);
            Assert.True(customers[0].StartPlatform == 'J');
            Assert.True(customers[0].DropOffPlatform == 'r');
            Assert.True(customers[0].dropOffTime == 10);
            Assert.True(customers[0].dropOffPoints == 100);

            Assert.True(customers[1].name == "Carol");
            Assert.True(customers[1].SpawnTime == 30);
            Assert.True(customers[1].StartPlatform == 'r');
            Assert.True(customers[1].DropOffPlatform == '^');
            Assert.True(customers[1].dropOffTime == 10);
            Assert.True(customers[1].dropOffPoints == 100);
        }
示例#3
0
 public void LevelTb()
 {
     levelCreator = new LevelCreator();
     levelCreator.CreateLevel("the-beach.txt");
     Assert.True(levelCreator.Obstacles.CountEntities() == 253);
     Assert.True(levelCreator.Platforms.Count == 27);
     Assert.True(levelCreator.Exits.CountEntities() == 6);
     Assert.True(levelCreator.playerpos.ToString() == "Vec2F(0,3750001,0,3479497)");
 }
示例#4
0
 public void LevelSnS()
 {
     levelCreator = new LevelCreator();
     levelCreator.CreateLevel("short-n-sweet.txt");
     Assert.True(levelCreator.Obstacles.CountEntities() == 173);
     Assert.True(levelCreator.Platforms.Count == 13);
     Assert.True(levelCreator.Exits.CountEntities() == 6);
     Assert.True(levelCreator.playerpos.ToString() == "Vec2F(0,7749998,0,8261199)");
 }
示例#5
0
        public void CustomerCollision()
        {
            player = new Player();
            player.SpawnPos(new Vec2F(0.5F, 0.6F));
            levelCreator = new LevelCreator();
            levelCreator.CreateLevel("the-beach.txt");
            customer = new Customer(levelCreator.Customer[0]);
            customer.SpawnPosition(new Vec2F(0.5F, 0.5F));
            bool col = false;

            while (player.Shape.Position.Y > 0.45F && col == false)
            {
                player.Move();
                col = Collision.CustomerCollision(player, customer);
                Console.WriteLine(col);
            }
            Assert.True(col);
        }
示例#6
0
        public void LevelSnScustomer()
        {
            levelCreator = new LevelCreator();
            customers    = new List <Customer>();
            levelCreator.CreateLevel("short-n-sweet.txt");
            foreach (var customer in levelCreator.Customer)
            {
                Customer cust = new Customer(customer);
                customers.Add(cust);
            }

            Assert.True(customers[0].name == "Alice");
            Assert.True(customers[0].SpawnTime == 1);
            Assert.True(customers[0].StartPlatform == '1');
            Assert.True(customers[0].DropOffPlatform == 'J');
            Assert.True(customers[0].dropOffTime == 10);
            Assert.True(customers[0].dropOffPoints == 100);
        }
示例#7
0
 void Update()
 {
     if (!_readingHandGesture && (MLHands.Left.HandConfidence > 0.88f && MLHands.Left.KeyPose == MLHandKeyPose.L || MLHands.Right.HandConfidence > 0.88f && MLHands.Right.KeyPose == MLHandKeyPose.L))
     {
         _readingHandGesture = true;
         EnableMeshing();
         levelCreator.ClearLevel();
     }
     else if (!_readingHandGesture && MLHands.Left.HandConfidence > 0.88f && MLHands.Left.KeyPose == MLHandKeyPose.Ok || MLHands.Right.HandConfidence > 0.88f && MLHands.Right.KeyPose == MLHandKeyPose.Ok)
     {
         _readingHandGesture = true;
         DisableMeshing();
         levelCreator.CreateLevel();
     }
     else
     {
         _readingHandGesture = false;
     }
 }
示例#8
0
        public void InitializeGameState()
        {
            GameRunning.gameTimer = new Stopwatch();
            GameRunning.gameTimer.Start();


            backGroundImage = new Entity(new StationaryShape(new Vec2F(0.0f, 0.0f),
                                                             new Vec2F(1.0f, 1.0f)),
                                         new Image(Path.Combine("Assets", "Images", "SpaceBackground.png"))
                                         );
            levelCreator = new LevelCreator();
            level        = levelCreator.CreateLevel(GameRunning.map);
            player       = new Player();
            player.SpawnPos(levelCreator.playerpos);
            CustomerList      = new List <Customer>();
            CustomersPickedUp = new List <Customer>();
            foreach (var customer in levelCreator.Customer)
            {
                Customer customer1 = new Customer(customer);
                CustomerList.Add(customer1);
            }
            points = new PointDisplay();
        }
示例#9
0
 private void NextLevel()
 {
     levelCreator.CreateLevel();
 }