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.
 

144 lines
4.5 KiB

#include "..\C-Engine\CEngine.hpp"
#include "generateur.hpp"
#include "monstres.hpp"
#include "GUI.hpp"
#include "Perso.hpp"
int Jeu()
{
//*************Sprites*************\\
#include "Sprites.hpp"
//*************Object*************\\
Object * Perso = new Object;
Perso->GetTransform()->SetXY( 20, 20 );
Perso->GetRender()->SetRender( A_Perso , 9);
Perso->AffectTag("Perso");
Perso->AddRigidBody();
Control * ScriptPerso = new Control;
Perso->AffectScript(ScriptPerso);
Object * epee = new Object;
epee->GetRender ()->SetRender (A_epee);
ScriptPerso->p_epee = epee;
//***********Generateur************\\
MonsterPattern P_Slime("Slime",A_Slime,3,10,10,0);
MonsterPattern P_Tab[]={P_Slime};
MonsterPattern P_SacPV("SacPV",A_SacPV,3,10,10,-1);
MonsterPattern P_Tab1[]={P_SacPV};
Object * GenerateurSlime1 = new Object;
Generateur * ScriptGenerateur1 = new Generateur;
GenerateurSlime1->AffectScript(ScriptGenerateur1);
Object * GenerateurSlime2 = new Object;
Generateur * ScriptGenerateur2 = new Generateur;
GenerateurSlime2->AffectScript(ScriptGenerateur2);
Object * GenerateurSacPV = new Object;
Generateur * ScriptGenerateurSacPV = new Generateur;
GenerateurSacPV->AffectScript(ScriptGenerateurSacPV);
ScriptGenerateur1->SetBox(0,156,210,419);
ScriptGenerateur1->ShowBox();
ScriptGenerateur1->SetTab(1,P_Tab);
ScriptGenerateur2->SetBox(322,419,308,419);
ScriptGenerateur2->SetTab(1,P_Tab);
ScriptGenerateurSacPV->SetBox(266,419,0,56);
ScriptGenerateurSacPV->SetTab(1,P_Tab1);
//*************Map*************\\
Level * mapPrincipal = new Level;
mapPrincipal->SetMap(tileset , M_mapprincipal, tileprop , 14 , 14 ,30,30);
Level * maison1 = new Level;
maison1->SetMap(tilesethouse, M_maison1 , tileprophouse , 14 , 14 , 15 , 6);
Level * maison2 = new Level;
maison2->SetMap(tilesethouse, M_maison2 , tileprophouse , 14 , 14 , 9 , 6);
Level * maison3 = new Level;
maison3->SetMap(tilesethouse, M_maison3 , tileprophouse , 14 , 14 , 11 , 6);
Level * world[]={mapPrincipal,maison1,maison2,maison3};
Trigger * Trigger1 = new Trigger; Trigger1->CreateTrigger(170,97,10,2); Trigger1->SetDestination( 29 , 3 , 1 , "Perso");
Trigger * Trigger2 = new Trigger; Trigger2->CreateTrigger(30,1,10,2); Trigger2->SetDestination( 169 , 85 , 0 , "Perso");
Trigger * Trigger3 = new Trigger; Trigger3->CreateTrigger(198,97,10,2); Trigger3->SetDestination( 169 , 3 , 1 , "Perso");
Trigger * Trigger4 = new Trigger; Trigger4->CreateTrigger(170,1,10,2); Trigger4->SetDestination( 197 , 85 , 0 , "Perso");
Trigger * Trigger5 = new Trigger; Trigger5->CreateTrigger(58,83,10,2); Trigger5->SetDestination( 57 , 3 , 2 , "Perso");
Trigger * Trigger6 = new Trigger; Trigger6->CreateTrigger(58,1,10,2); Trigger6->SetDestination( 57 , 69 , 0 , "Perso");
Trigger * Trigger7 = new Trigger; Trigger7->CreateTrigger(72,125,10,2); Trigger7->SetDestination( 113 , 3 , 3 , "Perso");
Trigger * Trigger8 = new Trigger; Trigger8->CreateTrigger(114,1,10,2); Trigger8->SetDestination( 71 , 113 , 0 , "Perso");
//*************Moteur*************\\
Engine Game;
Game.SetLevel(world,4);
Game.AddObject(GenerateurSlime1,0);
Game.AddObject(GenerateurSlime2,0);
Game.AddObject(GenerateurSacPV,0);
Game.AddObject(Perso , 0);
Game.AddObject(epee , 0);
Game.AddObject(Trigger1,0);
Game.AddObject(Trigger2,1);
Game.AddObject(Trigger3,0);
Game.AddObject(Trigger4,1);
Game.AddObject(Trigger5,0);
Game.AddObject(Trigger6,2);
Game.AddObject(Trigger7,0);
Game.AddObject(Trigger8,3);
Game.SetCurrentLevel(0);
GUI * scriptGui = new GUI;
Game.AffectGui(scriptGui);
Game.StartGame();
return 1;
}
extern "C"
{
int AddIn_main(int isAppli, unsigned short OptionNum)
{
Jeu();
return 1;
}
#pragma section _BR_Size
unsigned long BR_Size;
#pragma section
#pragma section _TOP
int InitializeSystem(int isAppli, unsigned short OptionNum)
{
return INIT_ADDIN_APPLICATION(isAppli, OptionNum);
}
#pragma section
}