You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GoldQuest.cpp 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #include "..\C-Engine\CEngine.hpp"
  2. #include "generateur.hpp"
  3. #include "monstres.hpp"
  4. #include "GUI.hpp"
  5. #include "Perso.hpp"
  6. int Jeu()
  7. {
  8. //*************Sprites*************\\
  9. #include "Sprites.hpp"
  10. //*************Object*************\\
  11. Object * Perso = new Object;
  12. Perso->GetTransform()->SetXY( 20, 20 );
  13. Perso->GetRender()->SetRender( A_Perso , 9);
  14. Perso->AffectTag("Perso");
  15. Perso->AddRigidBody();
  16. Control * ScriptPerso = new Control;
  17. Perso->AffectScript(ScriptPerso);
  18. Object * epee = new Object;
  19. epee->GetRender ()->SetRender (A_epee);
  20. ScriptPerso->p_epee = epee;
  21. //***********Generateur************\\
  22. MonsterPattern P_Slime("Slime",A_Slime,3,10,10,0);
  23. MonsterPattern P_Tab[]={P_Slime};
  24. MonsterPattern P_SacPV("SacPV",A_SacPV,3,10,10,-1);
  25. MonsterPattern P_Tab1[]={P_SacPV};
  26. Object * GenerateurSlime1 = new Object;
  27. Generateur * ScriptGenerateur1 = new Generateur;
  28. GenerateurSlime1->AffectScript(ScriptGenerateur1);
  29. Object * GenerateurSlime2 = new Object;
  30. Generateur * ScriptGenerateur2 = new Generateur;
  31. GenerateurSlime2->AffectScript(ScriptGenerateur2);
  32. Object * GenerateurSacPV = new Object;
  33. Generateur * ScriptGenerateurSacPV = new Generateur;
  34. GenerateurSacPV->AffectScript(ScriptGenerateurSacPV);
  35. ScriptGenerateur1->SetBox(0,156,210,419);
  36. ScriptGenerateur1->ShowBox();
  37. ScriptGenerateur1->SetTab(1,P_Tab);
  38. ScriptGenerateur2->SetBox(322,419,308,419);
  39. ScriptGenerateur2->SetTab(1,P_Tab);
  40. ScriptGenerateurSacPV->SetBox(266,419,0,56);
  41. ScriptGenerateurSacPV->SetTab(1,P_Tab1);
  42. //*************Map*************\\
  43. Level * mapPrincipal = new Level;
  44. mapPrincipal->SetMap(tileset , M_mapprincipal, tileprop , 14 , 14 ,30,30);
  45. Level * maison1 = new Level;
  46. maison1->SetMap(tilesethouse, M_maison1 , tileprophouse , 14 , 14 , 15 , 6);
  47. Level * maison2 = new Level;
  48. maison2->SetMap(tilesethouse, M_maison2 , tileprophouse , 14 , 14 , 9 , 6);
  49. Level * maison3 = new Level;
  50. maison3->SetMap(tilesethouse, M_maison3 , tileprophouse , 14 , 14 , 11 , 6);
  51. Level * world[]={mapPrincipal,maison1,maison2,maison3};
  52. Trigger * Trigger1 = new Trigger; Trigger1->CreateTrigger(170,97,10,2); Trigger1->SetDestination( 29 , 3 , 1 , "Perso");
  53. Trigger * Trigger2 = new Trigger; Trigger2->CreateTrigger(30,1,10,2); Trigger2->SetDestination( 169 , 85 , 0 , "Perso");
  54. Trigger * Trigger3 = new Trigger; Trigger3->CreateTrigger(198,97,10,2); Trigger3->SetDestination( 169 , 3 , 1 , "Perso");
  55. Trigger * Trigger4 = new Trigger; Trigger4->CreateTrigger(170,1,10,2); Trigger4->SetDestination( 197 , 85 , 0 , "Perso");
  56. Trigger * Trigger5 = new Trigger; Trigger5->CreateTrigger(58,83,10,2); Trigger5->SetDestination( 57 , 3 , 2 , "Perso");
  57. Trigger * Trigger6 = new Trigger; Trigger6->CreateTrigger(58,1,10,2); Trigger6->SetDestination( 57 , 69 , 0 , "Perso");
  58. Trigger * Trigger7 = new Trigger; Trigger7->CreateTrigger(72,125,10,2); Trigger7->SetDestination( 113 , 3 , 3 , "Perso");
  59. Trigger * Trigger8 = new Trigger; Trigger8->CreateTrigger(114,1,10,2); Trigger8->SetDestination( 71 , 113 , 0 , "Perso");
  60. //*************Moteur*************\\
  61. Engine Game;
  62. Game.SetLevel(world,4);
  63. Game.AddObject(GenerateurSlime1,0);
  64. Game.AddObject(GenerateurSlime2,0);
  65. Game.AddObject(GenerateurSacPV,0);
  66. Game.AddObject(Perso , 0);
  67. Game.AddObject(epee , 0);
  68. Game.AddObject(Trigger1,0);
  69. Game.AddObject(Trigger2,1);
  70. Game.AddObject(Trigger3,0);
  71. Game.AddObject(Trigger4,1);
  72. Game.AddObject(Trigger5,0);
  73. Game.AddObject(Trigger6,2);
  74. Game.AddObject(Trigger7,0);
  75. Game.AddObject(Trigger8,3);
  76. Game.SetCurrentLevel(0);
  77. GUI * scriptGui = new GUI;
  78. Game.AffectGui(scriptGui);
  79. Game.StartGame();
  80. return 1;
  81. }
  82. extern "C"
  83. {
  84. int AddIn_main(int isAppli, unsigned short OptionNum)
  85. {
  86. Jeu();
  87. return 1;
  88. }
  89. #pragma section _BR_Size
  90. unsigned long BR_Size;
  91. #pragma section
  92. #pragma section _TOP
  93. int InitializeSystem(int isAppli, unsigned short OptionNum)
  94. {
  95. return INIT_ADDIN_APPLICATION(isAppli, OptionNum);
  96. }
  97. #pragma section
  98. }