Exemplo n.º 1
0
void Physics::addStage2(void) {
  addGround("ground", 0, 0, 0, 0, 8000, 0, 8000);
  addGoal("goal", 50, 25, 1000, 0);
  addWall("barrior_s", 0, 60, -200, 0, 500, 60, 50);
  addWall("barrior_n", 0, 60, 1200, 0, 500, 60, 50);
  addWall("barrior_w", 550, 60, 500, SIMD_HALF_PI, 650, 60, 50);
  addWall("barrior_e", -550, 60, 500, SIMD_HALF_PI, 650, 60, 50);

//   addWall("wall0", 450, 60, -100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall1", 350, 60, -100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall2", 250, 60, -100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall3", 150, 60, -100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall4", 50, 60, -100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall5", -50, 60, -100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall6", -150, 60, -100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall7", -250, 60, -100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall8", -350, 60, -100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall9", -450, 60, -100, 0, 50, 60, 50, INVISIBLE);


//   addWall("wall10", 450, 60, 0, 0, 50, 60, 50, INVISIBLE);
  addWall("wall11", 350, 60, 0, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall12", 250, 60, 0, 0, 50, 60, 50, INVISIBLE);
  addWall("wall13", 150, 60, 0, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall14", 50, 60, 0, 0, 50, 60, 50, INVISIBLE);
  addWall("wall15", -50, 60, 0, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall16", -150, 60, 0, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall17", -250, 60, 0, 0, 50, 60, 50, INVISIBLE);
  addWall("wall18", -350, 60, 0, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall19", -450, 60, 0, 0, 50, 60, 50, INVISIBLE);

//   addWall("wall20", 450, 60, 100, 0, 50, 60, 50, INVISIBLE);
  addWall("wall21", 350, 60, 100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall22", 250, 60, 100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall23", 150, 60, 100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall24", 50, 60, 100, 0, 50, 60, 50, INVISIBLE);
  addWall("wall25", -50, 60, 100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall26", -150, 60, 100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall27", -250, 60, 100, 0, 50, 60, 50, INVISIBLE);
  addWall("wall28", -350, 60, 100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall29", -450, 60, 100, 0, 50, 60, 50, INVISIBLE);

  addWall("wall30", 450, 60, 200, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall31", 350, 60, 200, 0, 50, 60, 50, INVISIBLE);
  addWall("wall32", 250, 60, 200, 0, 50, 60, 50, INVISIBLE);
  addWall("wall33", 150, 60, 200, 0, 50, 60, 50, INVISIBLE);
  addWall("wall34", 50, 60, 200, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall35", -50, 60, 200, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall36", -150, 60, 200, 0, 50, 60, 50, INVISIBLE);
  addWall("wall37", -250, 60, 200, 0, 50, 60, 50, INVISIBLE);
  addWall("wall38", -350, 60, 200, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall39", -450, 60, 200, 0, 50, 60, 50, INVISIBLE);

//   addWall("wall40", 450, 60, 300, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall41", 350, 60, 300, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall42", 250, 60, 300, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall43", 150, 60, 300, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall44", 50, 60, 300, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall45", -50, 60, 300, 0, 50, 60, 50, INVISIBLE);
  addWall("wall46", -150, 60, 300, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall47", -250, 60, 300, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall48", -350, 60, 300, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall49", -450, 60, 300, 0, 50, 60, 50, INVISIBLE);

//   addWall("wall50", 450, 60, 400, 0, 50, 60, 50, INVISIBLE);
  addWall("wall51", 350, 60, 400, 0, 50, 60, 50, INVISIBLE);
  addWall("wall52", 250, 60, 400, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall53", 150, 60, 400, 0, 50, 60, 50, INVISIBLE);
  addWall("wall54", 50, 60, 400, 0, 50, 60, 50, INVISIBLE);
  addWall("wall55", -50, 60, 400, 0, 50, 60, 50, INVISIBLE);
  addWall("wall56", -150, 60, 400, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall57", -250, 60, 400, 0, 50, 60, 50, INVISIBLE);
  addWall("wall58", -350, 60, 400, 0, 50, 60, 50, INVISIBLE);
  addWall("wall59", -450, 60, 400, 0, 50, 60, 50, INVISIBLE);

//   addWall("wall60", 450, 60, 500, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall61", 350, 60, 500, 0, 50, 60, 50, INVISIBLE);
  addWall("wall62", 250, 60, 500, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall63", 150, 60, 500, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall64", 50, 60, 500, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall65", -50, 60, 500, 0, 50, 60, 50, INVISIBLE);
  addWall("wall66", -150, 60, 500, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall67", -250, 60, 500, 0, 50, 60, 50, INVISIBLE);
  addWall("wall68", -350, 60, 500, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall69", -450, 60, 500, 0, 50, 60, 50, INVISIBLE);

  addWall("wall70", 450, 60, 600, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall71", 350, 60, 600, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall72", 250, 60, 600, 0, 50, 60, 50, INVISIBLE);
  addWall("wall73", 150, 60, 600, 0, 50, 60, 50, INVISIBLE);
  addWall("wall74", 50, 60, 600, 0, 50, 60, 50, INVISIBLE);
  addWall("wall75", -50, 60, 600, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall76", -150, 60, 600, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall77", -250, 60, 600, 0, 50, 60, 50, INVISIBLE);
  addWall("wall78", -350, 60, 600, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall79", -450, 60, 600, 0, 50, 60, 50, INVISIBLE);

//   addWall("wall80", 450, 60, 700, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall81", 350, 60, 700, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall82", 250, 60, 700, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall83", 150, 60, 700, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall84", 50, 60, 700, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall85", -50, 60, 700, 0, 50, 60, 50, INVISIBLE);
  addWall("wall86", -150, 60, 700, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall87", -250, 60, 700, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall88", -350, 60, 700, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall89", -450, 60, 700, 0, 50, 60, 50, INVISIBLE);

//   addWall("wall90", 450, 60, 800, 0, 50, 60, 50, INVISIBLE);
  addWall("wall91", 350, 60, 800, 0, 50, 60, 50, INVISIBLE);
  addWall("wall92", 250, 60, 800, 0, 50, 60, 50, INVISIBLE);
  addWall("wall93", 150, 60, 800, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall94", 50, 60, 800, 0, 50, 60, 50, INVISIBLE);
  addWall("wall95", -50, 60, 800, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall96", -150, 60, 800, 0, 50, 60, 50, INVISIBLE);
  addWall("wall97", -250, 60, 800, 0, 50, 60, 50, INVISIBLE);
  addWall("wall98", -350, 60, 800, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall99", -450, 60, 800, 0, 50, 60, 50, INVISIBLE);

//   addWall("wall100", 450, 60, 900, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall101", 350, 60, 900, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall102", 250, 60, 900, 0, 50, 60, 50, INVISIBLE);
  addWall("wall103", 150, 60, 900, 0, 50, 60, 50, INVISIBLE);
  addWall("wall104", 50, 60, 900, 0, 50, 60, 50, INVISIBLE);
  addWall("wall105", -50, 60, 900, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall106", -150, 60, 900, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall107", -250, 60, 900, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall108", -350, 60, 900, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall109", -450, 60, 900, 0, 50, 60, 50, INVISIBLE);

//   addWall("wall110", 450, 60, 1000, 0, 50, 60, 50, INVISIBLE);
  addWall("wall111", 350, 60, 1000, 0, 50, 60, 50, INVISIBLE);
  addWall("wall112", 250, 60, 1000, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall113", 150, 60, 1000, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall114", 50, 60, 1000, 0, 50, 60, 50, INVISIBLE);
  addWall("wall115", -50, 60, 1000, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall116", -150, 60, 1000, 0, 50, 60, 50, INVISIBLE);
  addWall("wall117", -250, 60, 1000, 0, 50, 60, 50, INVISIBLE);
  addWall("wall118", -350, 60, 1000, 0, 50, 60, 50, INVISIBLE);
  addWall("wall119", -450, 60, 1000, 0, 50, 60, 50, INVISIBLE);

//   addWall("wall120", 450, 60, 1100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall121", 350, 60, 1100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall122", 250, 60, 1100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall123", 150, 60, 1100, 0, 50, 60, 50, INVISIBLE);
  addWall("wall124", 50, 60, 1100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall125", -50, 60, 1100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall126", -150, 60, 1100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall127", -250, 60, 1100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall128", -350, 60, 1100, 0, 50, 60, 50, INVISIBLE);
//   addWall("wall129", -450, 60, 1100, 0, 50, 60, 50, INVISIBLE);

  movePenguin(btVector3(25, 25, -100));
  checkpoint = btVector3(25, 25, -100);
  jumping = false;
}
Exemplo n.º 2
0
void Game::update()
{
	_gameWindow.update();
	movePenguin();
}
Exemplo n.º 3
0
void Physics::addStage1(void) {
  addGround("ground", 0, 0, 0, 0, 8000, 0, 8000, KILLBOX);
  addWall("south0", 0, 440, 0, 0, 760, 40, 120);   // start
  addWall("wall1", 0, 520, 160, 0, 80, 40, 40);  // stairs 1
  addWall("wall2", 0, 600, 240, 0, 80, 40, 40);
  addWall("wall3", 0, 680, 360, 0, 80, 40, 80);
  addWall("wall4", -220, 700, 540, 0, 40, 10, 40);
  addWall("wall5", -540, 740, 460, 0, 40, 10, 40);
  addWall("wall6", -320, 820, 380, 0, 40, 10, 40);
  addWall("wall7", -20, 860, 370, 0, 40, 10, 40);
  addWall("wall8", 420, 840, 420, 0, 40, 10, 40);
  addWall("wall9", 820, 900, 420, 0, 40, 10, 40);
  addWall("west0", 880, 1030, 800, 0, 120, 40, 670); 
  addWall("wall10", 1340, 780, 660, 0, 40, 10, 40);
  addWall("wall11", 1820, 700, 320, 0, 40, 10, 40);
  addWall("wall12", 2060, 760, 400, 0, 40, 10, 40);
  addWall("wall12_2", 2060, 760, 800, 0, 40, 10, 40);
  addWall("wall13", 1810, 780, 1200, 0, 40, 10, 60);
  addWall("wall14", 1380, 800, 1300, 0, 40, 40, 80);  // stairs 2
  addWall("wall15", 1260, 880, 1300, 0, 40, 40, 80);
  addWall("wall16", 1140, 970, 1300, 0, 40, 40, 80);
  addWall("wall17", 170, 1100, 1000, 0, 280, 20, 100, CHECKPOINT);
  addWall("east0", -880, 840, 800, 0, 120, 40, 670);
  addWall("wall18", -960, 960, 300, 0, 20, 10, 20);
  addWall("wall19", -840, 1010, 370, 0, 20, 10, 20);
  addWall("wall20", -760, 1040, 410, 0, 20, 10, 20);
  addWall("wall21", -540, 1100, 500, 0, 20, 10, 20);
  addWall("wall22", -540, 1140, 620, 0, 20, 10, 20);
  addWall("wall23", -540, 1210, 500, 0, 20, 10, 20);
  addWall("wall24", -580, 1280, 300, 0, 20, 10, 20);
  addWall("wall25", -600, 1300, 600, 0, 20, 10, 20);  // Stepping stone
  addWall("wall26", -620, 1350, 680, 0, 10, 10, 10);
  addWall("wall27", -580, 1355, 720, 0, 10, 10, 10);
  addWall("wall28", -580, 1360, 1120, 0, 10, 10, 10);
  addWall("wall29", -250, 1370, 1060, 0, 10, 10, 10);
  addWall("wall30", 0, 1400, 1000, 0, 15, 10, 15);
  addWall("wall31", -100, 1460, 1300, 0, 35, 10, 35);
  addWall("wall32", 0, 1460, 1600, 0, 28, 10, 28);
  addWall("wall33", 100, 1460, 1300, 0, 35, 10, 35);
  addWall("wall34", 0, 1500, 1950, 0, 100, 10, 40, CHECKPOINT);
  addWall("wall35", 0, 1560, 2300, 0, 40, 10, 40);
  addWall("north0", 0, 2360, 1600, 0, 750, 800, 120);  // great wall climb
  addWall("wall36", 300, 1640, 2200, 0, 80, 15, 40);
  addWall("wall37", 500, 1670, 1750, 0, 60, 15, 30);
  addWall("wall38", 100, 1700, 1750, 0, 60, 15, 30);
  addWall("wall39", -50, 1770, 1750, 0, 60, 10, 30);
  addWall("wall40", 150, 1835, 1750, 0, 70, 15, 30);
  addWall("wall41", 300, 1900, 1750, 0, 70, 15, 30);
  addWall("wall42", 450, 1970, 1750, 0, 50, 15, 30);
  addWall("wall43", 600, 2140, 1750, 0, 60, 15, 30);
  addWall("wall44", 350, 2200, 1750, 0, 70, 15, 30);
  addWall("wall45", 0, 2000, 1750, 0, 40, 15, 30);
  addWall("wall46", -180, 2080, 1750, 0, 40, 15, 30);
  addWall("wall47", 180, 2130, 1750, 0, 60, 15, 30);
  addWall("wall48", 980, 2220, 1750, 0, 70, 10, 30);
  addWall("wall49", 700, 2300, 1750, 0, 70, 10, 30);
  addWall("wall50", 300, 2360, 1750, 0, 70, 10, 30);
  addWall("wall51", 0, 2420, 1750, 0, 70, 10, 30);
  addWall("wall52", -300, 2490, 1750, 0, 70, 10, 30);
  addWall("wall53", -600, 2545, 1750, 0, 70, 10, 30);
  addWall("wall54", -900, 2620, 1750, 0, 70, 10, 30);
  addWall("wall55", -750, 2700, 1750, 0, 70, 10, 30);
  addWall("wall56", -1050, 2780, 1650, 0, 70, 10, 30, CHECKPOINT);
  addWall("wall57", -1050, 2840, 1400, 0, 40, 10, 40);
  addWall("wall58", -1050, 2920, 1200, 0, 40, 10, 40);
  addWall("wall59", -1050, 3000, 1100, 0, 40, 10, 40);
  addWall("wall60", -800, 3080, 1000, 0, 40, 10, 40);
  addGoal("goal", -400, 2800, 1000, 0);
  addWall("pillarsw", 880, 2000, 0, 0, 120, 1600, 120);
  addWall("pillarnw", 880, 2000, 1600, 0, 120, 1600, 120);
  addWall("pillarne", -880, 2000, 1600, 0, 120, 1250, 120);
  addWall("pillarse", -880, 2000, 0, 0, 120, 1600, 120);
  movePenguin(btVector3(0, 505, 0));
  checkpoint = btVector3(0, 505, 0);
  jumping = true;
}