Browse Source

First commit

master
Fife 5 years ago
parent
commit
2de6dc00c6
10 changed files with 1348 additions and 0 deletions
  1. +149
    -0
      EScript.cpp
  2. +14
    -0
      EScript.hpp
  3. +415
    -0
      GScript.cpp
  4. +50
    -0
      GScript.hpp
  5. +58
    -0
      GSprite.hpp
  6. +164
    -0
      Geometry.cpp
  7. +341
    -0
      Menu.cpp
  8. +15
    -0
      Menu.hpp
  9. +97
    -0
      Save.cpp
  10. +45
    -0
      Save.hpp

+ 149
- 0
EScript.cpp View File

@ -0,0 +1,149 @@
#include "..\C-Engine\CHeader.hpp"
#include "EScript.hpp"
void EngineControl::Update()
{
if((int)GetEngine()->GetListeObject()[0]->GetTransforms()->GetX() % 12 < 3)
{
UpdateScenary();
}
}
void EngineControl::UpdateScenary()
{
int stop = GetEngine()->GetNbObject();
for(int i = 1; i < stop ; i++)
{
if(GetEngine()->GetListeObject()[i]->GetTransforms()->GetX() < (GetEngine()->GetListeObject()[0]->GetTransforms()->GetX() - 36))
{
GetEngine()->DelObject(GetEngine()->GetListeObject()[i]);
i--;
stop --;
}
}
SetDecor(((int)GetEngine()->GetListeObject()[0]->GetTransforms()->GetX() / 12) + 10);
}
void EngineControl::SetDecor(int i)
{
int dify , difx, w , h , type;
if(GetEngine()->GetMap() == NULL)return;
for( int j = 0 ; j < GetEngine()->GetMap()->nbtiles_hauteur_monde; j++)
{
w = 0 ; h = 0; difx = 0; dify = 0; type = 0;
//Type = 0 rien //Type = 1 pics //Type = 2 jump //Type = 3 doublejump //Type = 4 portail ->navette //Type = 5 portail ->cube
switch(GetEngine()->GetMap()->map[j][i] - '0')
{
case 7: w = 10 ; h = 10; type = 1; difx = 1;break;//Triangle pics
case 8: w = 10 ; h = 10; type = 1;difx = 1;break;//Triangle pics
case 5: w = 12 ; h = 4; type = 1;break; //Pics
case 6: w = 12 ; h = 4; type = 1;break; //Pics
case 9: w = 10 ; h = 6; type = 1;difx = 1;break; //Petit triangle droit
case 10: w = 10 ; h = 6; dify = 6; type = 1;difx = 1;break; //Petit triangle renverse
case 11: w = 8 ; h = 4; type = 2; break; //jump
case 12: w = 12 ; h = 12; type = 3; break;//Doublejump
case 16: w = 10 ; h = 22; dify = 1; type = 4; break;//Portail
case 18: w = 10 ; h = 22; dify = 1; type = 5; break;
case 20: w = 10 ; h = 10; type = 1; difx = 2; dify = 1; break;
case 21: w = 10 ; h = 10; type = 1; difx = 2; dify = 1; break;
default: w = 0 ; h = 0; type = 0; break;
}
if(type == 1)
{
Object * Buffer = new Object;
Buffer->GetTransforms()->SetXY( i * 12 + difx, ((GetEngine()->GetMap()->nbtiles_hauteur_monde - 1)* 12) - (j * 12) + 2 + dify);
Buffer->AddRigibody();
Buffer->GetRigibody()->UseFixeBody(w,h);
Buffer->AffectTag("Pic");
GetEngine()->AddObject(Buffer);
}
if(type == 2)
{
Object * Buffer = new Object;
Buffer->GetTransforms()->SetXY( i * 12 + 2 , ((GetEngine()->GetMap()->nbtiles_hauteur_monde - 1)* 12) - (j * 12) + 2 + dify);
Buffer->AddRigibody();
Buffer->GetRigibody()->UseFixeBody(w,h);
Buffer->AffectTag("Jump");
GetEngine()->AddObject(Buffer);
}
if(type == 3)
{
Object * Buffer = new Object;
Buffer->GetTransforms()->SetXY( i * 12 , ((GetEngine()->GetMap()->nbtiles_hauteur_monde - 1)* 12) - (j * 12) + 2 + dify);
Buffer->AddRigibody();
Buffer->GetRigibody()->UseFixeBody(w,h);
Buffer->AffectTag("DJ");
GetEngine()->AddObject(Buffer);
}
if(type == 4)
{
Object * Buffer = new Object;
Buffer->GetTransforms()->SetXY( i * 12 + 1, ((GetEngine()->GetMap()->nbtiles_hauteur_monde - 1)* 12) - (j * 12) + 2 + dify);
Buffer->AddRigibody();
Buffer->GetRigibody()->UseFixeBody(w,h);
Buffer->AffectTag("PN");
GetEngine()->AddObject(Buffer);
}
if(type == 5)
{
Object * Buffer = new Object;
Buffer->GetTransforms()->SetXY( i * 12 + 1, ((GetEngine()->GetMap()->nbtiles_hauteur_monde - 1)* 12) - (j * 12) + 2 + dify);
Buffer->AddRigibody();
Buffer->GetRigibody()->UseFixeBody(w,h);
Buffer->AffectTag("PC");
GetEngine()->AddObject(Buffer);
}
}
}

+ 14
- 0
EScript.hpp View File

@ -0,0 +1,14 @@
#ifndef ESCRIPT
#define ESCRIPT
class EngineControl: public Script
{
public:
void Update();
void UpdateScenary();
void SetDecor(int i);
};
#endif

+ 415
- 0
GScript.cpp
File diff suppressed because it is too large
View File


+ 50
- 0
GScript.hpp View File

@ -0,0 +1,50 @@
#ifndef RPGSCRIPT
#define RPGSCRIPT
#include "EScript.hpp"
#include "Save.hpp"
class Control: public Script
{
public:
void Start();
void Update();
void UpdateEverySecond();
void Die();
void End();
void Pause();
void EndScreen();
Save * UserSave;
int nlevel;
EngineControl * EC;
private:
int etat;
int xmax;
bool particule;
bool practice;
int ptime;
int spawnx;
int spawny;
int spawnetat;
bool usebar;
bool useautoretry;
bool useautocheck;
int jump;
int time;
int attemp;
bool waitingjump;
};
#endif

+ 58
- 0
GSprite.hpp View File

@ -0,0 +1,58 @@
const unsigned char P1[]={0xff, 0xff, 0x80, 0x1f, 0x80, 0x1f, 0x9f, 0x9f, 0x90, 0x9f, 0x90, 0x9f, 0x90, 0x9f, 0x90, 0x9f, 0x9f, 0x9f, 0x80, 0x1f, 0x80, 0x1f, 0xff, 0xff, };
const unsigned char P2[]={0xff, 0xff, 0x80, 0x1f, 0x80, 0x1f, 0xbf, 0xdf, 0xa0, 0x5f, 0xef, 0x7f, 0x9, 0xf, 0xf9, 0xff, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0xff, 0xff, };
const unsigned char P3[]={0xff, 0xff, 0x80, 0x1f, 0x80, 0x1f, 0xb9, 0xdf, 0xa9, 0x5f, 0xb9, 0xdf, 0x80, 0x1f, 0xbf, 0xdf, 0xa0, 0x5f, 0xbf, 0xdf, 0x80, 0x1f, 0xff, 0xff, };
const unsigned char P4[]={0xff, 0xff, 0x80, 0x1f, 0xb9, 0xdf, 0xa9, 0x5f, 0xb9, 0xdf, 0x80, 0x1f, 0xb9, 0xdf, 0xef, 0x7f, 0x0, 0xf, 0xff, 0xff, 0x80, 0x1f, 0xff, 0xff, };
const unsigned char P5[]={0xff, 0xff, 0x80, 0x1f, 0x9f, 0x9f, 0x90, 0x9f, 0x9f, 0x9f, 0x80, 0x1f, 0x80, 0x1f, 0xb9, 0xdf, 0xa9, 0x5f, 0xa9, 0x5f, 0xa9, 0x5f, 0xef, 0x7f, };
const unsigned char P6[]={0xff, 0xff, 0x80, 0x1f, 0x8f, 0x1f, 0x89, 0x1f, 0x89, 0x1f, 0x89, 0x1f, 0x89, 0x1f, 0x8f, 0x1f, 0xe0, 0x7f, 0x20, 0x4f, 0x20, 0x4f, 0x3f, 0xcf, };
const unsigned char P7[]={0xf9, 0xff, 0x89, 0x1f, 0x89, 0x1f, 0x89, 0x1f, 0x8f, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0x8f, 0x1f, 0x89, 0x1f, 0x89, 0x1f, 0x89, 0x1f, 0xf9, 0xff, };
const unsigned char P8[]={0x7f, 0xef, 0xc0, 0x3f, 0x80, 0x1f, 0x83, 0xdf, 0xba, 0x5f, 0xaa, 0x5f, 0xbb, 0xdf, 0x80, 0x1f, 0xe0, 0x7f, 0x2f, 0x4f, 0x29, 0x4f, 0x39, 0xcf, };
const unsigned char PlayerN[]={0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, };
const unsigned char Ship1[]={0xc, 0xf, 0xa, 0xf, 0x2a, 0xf, 0x3b, 0x8f, 0xe8, 0x6f, 0xaf, 0xdf, 0xa8, 0x5f, 0xe8, 0x5f, 0x3f, 0xef, 0x20, 0xf, };
Sprite S_Player1(P1 , PlayerN , 12 , 12 );
Animation A_P1(S_Player1);
Sprite S_Player2(P2 , PlayerN , 12 , 12 );
Animation A_P2(S_Player2);
Sprite S_Player3(P3 , PlayerN , 12 , 12 );
Animation A_P3(S_Player3);
Sprite S_Player4(P4 , PlayerN , 12 , 12 );
Animation A_P4(S_Player4);
Sprite S_Player5(P5 , PlayerN , 12 , 12 );
Animation A_P5(S_Player5);
Sprite S_Player6(P6 , PlayerN , 12 , 12 );
Animation A_P6(S_Player6);
Sprite S_Player7(P7 , PlayerN , 12 , 12 );
Animation A_P7(S_Player7);
Sprite S_Player8(P8 , PlayerN , 12 , 12 );
Animation A_P8(S_Player8);
Sprite S_Ship1(Ship1 , 12,10);
Animation A_Ship1(S_Ship1);
Animation A_Player1[]={ A_P1 , A_Ship1};
Animation A_Player2[]={ A_P2 , A_Ship1};
Animation A_Player3[]={ A_P3 , A_Ship1};
Animation A_Player4[]={ A_P4 , A_Ship1};
Animation A_Player5[]={ A_P5 , A_Ship1};
Animation A_Player6[]={ A_P6 , A_Ship1};
Animation A_Player7[]={ A_P7 , A_Ship1};
Animation A_Player8[]={ A_P8 , A_Ship1};
bool prop[]={0,1,1,1,0,0,0,0,0,0,0,0,0,0,1};
const unsigned char tileset[]={0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0xff, 0xff, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xbf, 0xdf, 0xaf, 0x5f, 0xbf, 0xdf, 0xbf, 0xdf, 0xbf, 0xdf, 0xbf, 0xdf, 0xaf, 0x5f, 0xbf, 0xdf, 0x80, 0x1f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xb9, 0xdf, 0xa9, 0x5f, 0xb9, 0xdf, 0x80, 0x1f, 0x80, 0x1f, 0xb9, 0xdf, 0xa9, 0x5f, 0xb9, 0xdf, 0x80, 0x1f, 0xff, 0xff, 0xa, 0xf, 0xa, 0xf, 0x6, 0xf, 0x4, 0xf, 0xe, 0xf, 0xa, 0xf, 0xa, 0xf, 0x6, 0xf, 0x4, 0xf, 0xe, 0xf, 0xa, 0xf, 0xa, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x1, 0xf, 0x42, 0x8f, 0xa2, 0x8f, 0xa2, 0x8f, 0xaa, 0x8f, 0xb6, 0xcf, 0xa6, 0xaf, 0xa6, 0xaf, 0xff, 0xff, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x4, 0xf, 0xa, 0x4f, 0xa, 0xaf, 0x4a, 0xaf, 0xaa, 0xaf, 0xff, 0xff, 0x6, 0xf, 0x6, 0xf, 0x9, 0xf, 0x9, 0xf, 0x10, 0x8f, 0x10, 0x8f, 0x20, 0x4f, 0x20, 0x4f, 0x40, 0x2f, 0x40, 0x2f, 0x80, 0x1f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 0x40, 0x2f, 0x40, 0x2f, 0x20, 0x4f, 0x20, 0x4f, 0x10, 0x8f, 0x10, 0x8f, 0x9, 0xf, 0x9, 0xf, 0x6, 0xf, 0x6, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x6, 0xf, 0x9, 0xf, 0x10, 0x8f, 0x20, 0x4f, 0x40, 0x2f, 0x80, 0x1f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 0x40, 0x2f, 0x20, 0x4f, 0x10, 0x8f, 0x9, 0xf, 0x6, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0xf, 0xf, 0x10, 0x8f, 0x20, 0x4f, 0x3f, 0xcf, 0x0, 0xf, 0xf, 0xf, 0x10, 0x8f, 0x20, 0x4f, 0x46, 0x2f, 0x49, 0x2f, 0x49, 0x2f, 0x46, 0x2f, 0x20, 0x4f, 0x10, 0x8f, 0xf, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x7, 0xf, 0x5, 0xf, 0x7, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x2, 0xf, 0x7, 0xf, 0x5, 0xf, 0x7, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x6, 0xf, 0x9, 0xf, 0x3f, 0xcf, 0x40, 0x2f, 0x44, 0x2f, 0x42, 0x2f, 0x44, 0x2f, 0x62, 0x2f, 0x54, 0x2f, 0x52, 0x6f, 0x54, 0xef, 0x52, 0xef, 0x54, 0x6f, 0x52, 0x2f, 0x64, 0x2f, 0x42, 0x2f, 0x44, 0x2f, 0x42, 0x2f, 0x40, 0x2f, 0x3f, 0xcf, 0x9, 0xf, 0x6, 0xf, 0x0, 0xf, 0x0, 0xf, 0x6, 0xf, 0x9, 0xf, 0x3f, 0xcf, 0x40, 0x2f, 0x42, 0x2f, 0x44, 0x2f, 0x42, 0x2f, 0x44, 0x6f, 0x42, 0xaf, 0x64, 0xaf, 0x72, 0xaf, 0x74, 0xaf, 0x62, 0xaf, 0x44, 0xaf, 0x42, 0x6f, 0x44, 0x2f, 0x42, 0x2f, 0x44, 0x2f, 0x40, 0x2f, 0x3f, 0xcf, 0x9, 0xf, 0x6, 0xf, 0x0, 0xf, 0xff, 0xff, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0x80, 0x1f, 0xff, 0xff, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0xf, 0x0, 0x3f, 0x0, 0xdf, 0x3, 0x1f, 0xc, 0x1f, 0x30, 0x1f, 0xc0, 0x1f, 0xc0, 0x1f, 0x30, 0x1f, 0xc, 0x1f, 0x3, 0x1f, 0x0, 0xdf, 0x0, 0x3f, 0xc0, 0xf, 0xb0, 0xf, 0x8c, 0xf, 0x83, 0xf, 0x80, 0xcf, 0x80, 0x3f, 0x80, 0x3f, 0x80, 0xcf, 0x83, 0xf, 0x8c, 0xf, 0xb0, 0xf, 0xc0, 0xf, };

+ 164
- 0
Geometry.cpp View File

@ -0,0 +1,164 @@
#include "..\C-Engine\CHeader.hpp"
#include "Menu.hpp"
#include "GScript.hpp"
#include "EScript.hpp"
int Jeu(Save * UserSave , int nlevel , const unsigned char ** level ,int x , int y);
int StereoMadness(Save * UserSave)
{
const unsigned char * level1[]={
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044000000004400000000040000000040000000000000000000000000000000000000000000400400000000000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111000000000011111111111111111111111101111111111100001111111110000111111110000000000111111111",
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044000000004400000000040000000040000000000000000000000000000000000000000000400400000000000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000010000000000000010000000000100000000000001000000000010000000000000000000000101000000000100001000000010000100000010000000000100000001",
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111100000000000000000010000000001888888888888100000000000000000000188880000000000000000000000000000000000000888888888818888888888811111111111000000000000000000000000888000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044000000004400000000040000000040000000000000000000000000000000000000000000400400000000000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000010000000000000010000000000100000000000001000000000010000000000000000000000101000000000111111000000010000100000010000000000100000001",
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007001111111111111100000000000000000010000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000010000000000011111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044000000004400000000040000000040000000000000000000000000000000000000000000400400000000000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000010000000000000001000000001000000000000000100000000100000000000000000000000101000000000888888000000011111100000010000000000100000001",
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CC00000CC0000000777700000000000000000000000000000000000000000000000000000000C0011111111111111000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000011111111110000000000000000000000000000000000000000000000000010001CCC000000CC000000000000000000000000000000000000000000000000000000000000000000044000000004400000000040000000040000000000000000000000000000000000000000000400400000000000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000010000000000000000111111110000000000000000011111111000000000000000000000000101000000000000000000000088888800000011111111111100000001",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077770007777000000CCCC0000007000000000000000000000000000000000000000000000C000000001111111111110000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000011111111100000000000000000000000010000000000000000000001000100010000CCC00000CCC00000000000000000000000000000000000000000000000000000000000000044000000004400000000040000000040000000000000000000000000000000000000000000400400000000000000000000000000000000000010000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000101000000000000000000000000000000000000000000000000000001",
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100011111111111111111110000000001111100000000000000000000000000000000000000000C00000000000000000000000\?000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A00000000000000000000010001000000000000000001000100010001000000000000000000CC000000000000000000000000000000000000000000000000000000000011000000001100000000010000000010000000000000000000000000000000000000000000400400000000000000000000000000000000000000100090000000000000000000000000011000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000011100000000000101000000000000000000000000000000000000000000000000000001",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000111111111111111111111111111111117000000000070000000000000000000000000C000000000000000000000000000@000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0000000000000000010001000000000000000001000100010001000100000000000000000000011100000000000000000000000000000000000000000000000000000088000000008800000000080000000080000000000000000000000000000000000000000000400400000000000000000000000000000000CCC0000010100000000000000000000000000880000000000000000000000000000000000000000000000000000000000000\?0000000000000000000000000000000000000000000000000000000000010100000000000111000000000000000000000000000000000000000000000000000001",
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000001111111111111111111111111111111111CCCC00CCCC000000070000000000000C00000000000001111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111110000000000001000100000000000000000100010001000100010001000000000000000000000111000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001C000000000000000000040040000000000000000000000000000C0000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000@0000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000000001",
"0000000000000000000000000000000000000000001000000000000000000000000000000000000000070000010000000000000000111111111111111111111111111111111100000000000CCCCCCC000000000C0000000000000000000001111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000111111111111111111100010001000000011111110001000100010001000100010000000000000000000001110001110C00000000000000000000000000000CC00000000000000000000000000000000000000000000000000000000000000001000100C000000000000000001111000000000000000000000000C00000000000001000000000700000CC0000000000000000000000000000000000000000000C000000000007000000700000CCC0000010000000000000000111111110000000000000000011111111000000000010100000000000000000000000000000000000077777700000011111111111100000001",
"000000000000000000000000000000000000001000100000000000000000000000000000070000011111110000000000000000000011111111111111111111111111111111110000000000000000000CCCCC0000000000000000000000000111111111111111000000000000000000000000000000000000000000000000001000000000000000000000000000000000100000100000000000000000000000000000000000111111111111111111110001000100010001111111000100010001000100010001000000000000000000000111000111000C000000000000000CC000000CC00000000000000000000000000000000000000000000000000000000000000001000100010000C000000000000000888800000000000000000000C0000000000000000000100000C0C0C000000C000000000000000000000000000000000001CC00000C0000000C0C0CCCC0C0C0000000CCC010000000000000001000000001000000000000000100000000100000000010100000000000000000000000777777000000011111100000010000000000100000001",
"00000000000070000000009700000000771665156510000000000077000011111115561111111661111111656556655666655556651111111111111111111111111111111111565656656666666666556565665666565656656666666666511111111111111100000000000000000000000000001777777777777100000000177770000000000000000000000001777717777710000000000000000000000000000000000011111111111111111111665165616661655111111166515561556156515561665165666565656655566565511166511156556C000000007716556611165665655611177000000000770000000077000000000700000000700000000771566156516651655656C000000770000000000007100000000CCCC666565665656656655656665616656656666566566CCC7700000770000000001CC656C656CC11665656566CCC6665656565566565565556565510000000000000010000000000100000000000001000000000010000000010100000000000000000000000111111000000010000100000010000000000100000001",
"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000011111111110111111111111111111111111100001111111110000111111110000000000111111111",
};
Jeu(UserSave , 1 , level1 , 815 , 13);
return 1;
}
int BackOnTrack(Save * UserSave)
{
const unsigned char * level2[]={
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040040000000000000000000000000001111111111111111111000000011111111111111111111111111111111111111111100000000000000111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040040000000000000000000000000000000000000000000000100000100000000000100000000000000010000000000000010000000000001000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040040000000000000000000000000000000000000000000000010001000000000000010000000000000100000000000000001000000000010000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040044000400000000000000000000000000000000000000000001010000000000000000000000000000000000000000000000100000000100000000000000000011111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000040000004000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000040000000040000000040000000000000000000004040000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400040004000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CCCC40004700000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000100000010000000000000000000:::::::::000000000000000000>0011110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000040000004000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000000000040000000040000000040000000000000000000004040000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400040004000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000888000000000000000000000000000000000000000000000000000000CC00000000000000000000000000000000000000000000000000000000000000000044000000000000000CCCCCC000000000000000000000\?0000000000000000000000000000000000000000100000001000000000011110000000010000100000000000000000000000000000000000000000000000000>0011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000040000004000000000000000000000000000000000004000000004000000000000000000000000000000440000000000004444000000000000040000000040000000040000000000000000000004040000000000000000000000",
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111000000000000000000000000000000000000000000000000000000000000000000C000000000000000000700000000000000000000000000000000000;00000000000000000000000000000000000000000000000000000000070000000000CC00000C0000000000000000000000000000000C00000000;000000000000000000000004400000000;0000000000000000000C0000000000000@0000000000000000000000000000000000000000011111110000000000100001000000001111000000001111000000000000000000000000000000000000000000>0A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000010000001000000000000000000004004000000000004000700004000000000000000000000000000000440000000000004444000000000000010000000010000000010000000000000000000004040000000000700000000000",
"0000000000000000000000000000000000000000000000000000000000000000000000=00000000000000000000000000888888888888800000000000000000000000000000000000000000000000000000000000000C0000000000000000000000C0000000000000;0000000000000000000001000000000000000000000000000000000000000000000000=0001CCCC10000000000000000000C0000000000000000000000000C00000000C0001000000000000000000000001100000000100000000000000CC00000C0;00000000010000000000000000000000000000001000000000000000000000000001000000100000000000000000010000100000000000000000000000999999999900=00=00=0B0000000000000000000000000000000000000000000000000000070000000700000000000000000000000000010000001000000100000000000000000000400400000000000CCCCCCCCCC000000700000000000000000000000440000000000004444000000000000080000000080000000080000000000000000000001110000000010100000000000",
"000000000000000000000000000000000000000000000000000000000000000000=00010000000000000000007000000000000000000000000000000700000000000007000000000000000000070000000000000C0000000000000000000000C000000000000000001000000=00000000001000100000000000000010000000000000000000000000000=00010001000010CCC0;000000000000000CC000000000007000000C00000000000000001000000000000000000000008800000=00100000000000000000000000C000000C001000000000000000000000000000001010000000000000000000000001000000001000000000000000010000001000000011111111111111111111111111111111111100000000000000000000000C00000C000000000000000000000;0C0000000C0CC000000C000000000000000000000000000000000000000000000000000040040000000C000000000000000CCCCC00000000000000000000000110000000000001111000000000000000000000000000000000000000000100000010000000000100010000000000000",
"0000000000000000000000000000000000010000000000000C000000000000=0001000100000000000000000010000000000000000000000000000001000000=00000010000000000000001CCC100000700;00000000000000CCC000000C00000C000070000001000100000010000001000100010000000000010001000000000000000000000000=0001000100010000100000C000000000000000000001CCCCCCCCCC10000000000000000000010000000000000000000000000000001001000000000000000000000000000000000100000000000000000000000000001000100000000000000000000001000000000010000000000000010000000010000010000000000000000000000000000000000010000000000000000000C0000CC000000;000000000000000000C010000;0010000CC000000;00000000000000100000010000001000000070000000007004004000C0000000000000000000000000000000070000000000000088000000000000888800000000000001000000001000000001000000100010010001000000000010001000000;000000",
"0000000000;777700000770000000077156100000000;777777770000000771665156617770000007700070000000070000;000;000;0000000070000000077177700000;77771CCCC155615661561CCCCC1665656566656656656CC665656655661CC15616651565165665515616561655166516655651165516651561C177700007000077000771556165516561556616556555665555656566656656615656555665165565566556666565650177777700000000077000770000000016515665666665655556665555656566566561000000000000000000000000000100000100000000000000000000100000000000010000000000001000000000010001000000000000000000000000000000000000170000007700071C16656656656665651177770000000077156565156661561565565656661177770000000007100000710000071CCCCCCCCCC1566CCCC65CCCC000000000000000000000000000000CCCCCCC0000007000700000000007000700000000770000000071000000071000000071CC15661566155156616556665656166615665611770000",
"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000011111111111111111111000000000000001111111111110000000000001110000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
};
Jeu(UserSave , 2 , level2 , 825 , 13);
return 1;
}
int Polargeist(Save * UserSave)
{
const unsigned char * level3[]={
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000040004000400040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000040004000400010000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000010000000000000000000000000000000000000000000000000000000000000000000000000000040004000100010000004040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004040400000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000001000000010000000000000000010000000000000000000000000001000000010000000000000000000000000000000004000000000000000000000000000000000000000000040001000100000000004040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001040404000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000004000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000004000004000004000000000001",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000040000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000010000000100000010000000000000000000000000000000004040000000000000000000000000000000000000000010001000000000000001040404000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000000000000000000008010404040000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000001111111111000000000000000000000000000000000000000000000000000000000000000000400000440000000000000000000004000004000004000000000001",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000004400044000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000040040400400000000000000000000000000000000000000000040000000000040400000000000000000000000000000000000000000000000000000000000000000001000000000000001000000000000000000001000000000000000000000000100000000000000000000000000001000000000000000000000000000000000010000010000000000000000000000000000000004040400000000000000000000000000000000000000010000000000000000008010404040000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000080104040400000040000000000000000000400000000000000000000000000000000000000000000000000000000000000000400400000400000000000000000008888888888000000000000000000000000000000000000000000000000000000000000000000400000440000000000000000000004000004000004000000000001",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000004400044000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000040040400400000000000000000000000000000000000000000D1000000000004040000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000010000000000000000000000000000000000000001000000000000000000000000000000000111111000000000000000000000000000000000104040400000000000000000000000000000000000000000000000001000000008010404000000000000000000000000000000000070C00000000000=000000000000000000000000000000000000000000000000000000000000000000000100000801040400000040000000000000000000400000000000000000000000000000000000000000000000000000000000000000400400000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000400000440000000000000000000001000001000001000000000001",
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000004400044000000400000000004000000000000000000000000000400000000000000000000000000000000000000000000000000000040040400400000000000000000000000000000000000000000D1000000000001040000000000000000000000000000000000000000000000000000000000000000000\?0000000000000000000000000000001000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000A00000000000000000000000000000000080104040000000000000000000000000000000000000000000001000100001000008010400000000000000000000000000000000C0C0000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000801040000004000000000000000000D100000000000000000000000000000000000000000000000000000000000000000400400000100000000000000000000000000000007000000000000000000000000000000040000000000000000000000000000000400000110000000000000000000008000008000008000000000001",
"000000000000000000000000000000000000000000000000000000000000000000400400000000000000110001100000040000000000400000000000000000000000000D100000000000000000000000000000000000000000000000000000011111111100000000000000000000000000000000000000000D1000000000008010000000000000000000000000000000000000000000000000000000000000000000@0000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000B0000000000000000000000000000000000080104000000000000000000000000000000000000000001000100010000101000008010000000000000000000000000070C000000000000000<00010110000000000000000000000000000000000000000000000000000000000000;000000001000008010000001000000000000000000D1000000000000000000000000000000000000000000000000000000000000000001111000008000000000000000=0001111111111111E00000000000000000000000000000040000000000000000000000000000000100000880000000000000000000000000000000000000000000001",
"000000000000000000000000000000000000000000000000000000000000000000400400000000000000880008800000040000000000400000000000000000000000000D1000000000004000004000=00000000000000000000000000000000888888888000000000<0000000=0=00000000<000=;00000<00000000000000008000000000000000C00000000000000000000000000000000000000000000000000010000000000000000000000010000000000000000000000000000000000000000100000000000000000000000100000000000001000000000000000000000011111100000000=000000000000000000<000C000008010000000000000000000000000=00000=0=0001000100010001000010101000008000000000000000000000000C0C00000000000011000000010110000=000000=000000000000000000000000000000000000000000000=00010000000000100000800000080000000000000000000000000000000000;00000000000000000000000000000000000000000000000000888800000000000000000=00010001111111111111E00000000000000000000000000000040000000000000000000000000000000800000000000000000000000000001000001000001000070000001",
"0000000000000000000000000000000000000000000000000000000000=000<00040040000000000000000000000000004000700000040000000070000=000<0000=000D100000000000404000400010000000000000000000000700000000000000000000070<00000000<001110000<000000011000000000000000000C0000000000000C0000000C00000=0=040004000=00000=00000=00000=0000000000<0010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000100000000100000000<0000=0=00000000C00000800000000000000000=000<000100000111000100010001000100001010101000000000000000000000070C0000000000000000001100000001011000010000001000000<0000=000000=000000=000000000000000000010001000000000000100000000000000700<000000011000000=70000000000100000000000000000000000000000000000000000000000=0000000000010000000=000100010001100100010001E00000000007000000000000000000D100000000000000000=000000000000000000010000000000000000000=00100=00100=001000010000001",
"000000000000000000000<000000000000<00000000000000<0000=00010000000CCCC0000=000000000000000000000011111111111100000000100001000000001000000000000=000C04000C00010C000000000000000000001000000000000000000000100000000000001010000000000001100004000004000<00000C000=000<00000CC000000CC00111040004000C00000C00000C00000C000000<0000001000000000100000000000000000000000000010000000000010000000000000000000000000000000000000000000000000000000000001000000000000100000010111100010000<000000001110000000000C00000000000000000<000109999901011001010001000100010001000010101010100000000000000=000C0C0000000000000000000011000000010110000101100010110000000010000001000000100000000000=000100010001000000000000001000000001111100000110001101111111000000100010000000000<000000000<000000000000000000010000001000001000001000=0001000100010001100100010001E000007000010000<000=00700=000D100000000000000000100;0000000000100000100<000<0000000000001001001001001001001010000001",
"000000000000000000007777000000000777700000000000777777155616656656665666561770000000770007700;65666565666666656561000000071656565661000000000077165666C66565661566CC777000007700077000000070=070000000000;016565666656656101666566566566115656CCCCCCC56556656655CCC6566566656666566566551016CCCCC55666CC6556CC6656CC5666CC66566566551000000000000000000010000000000000000000000010000000000000000010000000000010000000001000000000000001000000000000000000000001000000010100156616555656656656101656556656566C000070007000099999915CCCCC6161156101566165616651566156651010101010100000700007716656656665656665666000000000;0656651511565616116561611666666661611565161165616110000007716561655156616566566656565656100000010001565661165611610000015616561556199999000099999000099999900007000007116561661665100000156165165616561656165610001100100010001E61111170000009999991111111000000000770007711165616517777000007165156199999999990000000771651651561651561651610000001",
"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101111111111111111111111111111111111111111111111111111111111111101111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000011100111111111111111111101111111111111111111111111111111111111111111111110111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110001111111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
};
Jeu(UserSave , 3 , level3 , 800 , 14);
return 1;
}
int Jeu(Save * UserSave , int nlevel , const unsigned char ** level ,int x , int y)
{
#include "GSprite.hpp"
//*****************Creation des objects******************
Object * Cube = new Object;
switch(UserSave->UserInfo->perso)
{
case 0: Cube->GetRender()->SetRender(A_Player1 , 2 ); break;
case 1: Cube->GetRender()->SetRender(A_Player2 , 2 ); break;
case 2: Cube->GetRender()->SetRender(A_Player3 , 2 ); break;
case 3: Cube->GetRender()->SetRender(A_Player4 , 2 ); break;
case 4: Cube->GetRender()->SetRender(A_Player5 , 2 ); break;
case 5: Cube->GetRender()->SetRender(A_Player6 , 2 ); break;
case 6: Cube->GetRender()->SetRender(A_Player7 , 2 ); break;
case 7: Cube->GetRender()->SetRender(A_Player8 , 2 ); break;
default:Cube->GetRender()->SetRender(A_Player1 , 2 ); break;
}
Control * Joueur = new Control;
Cube->AffectScript(Joueur);
Joueur->UserSave = UserSave;
Joueur->nlevel = nlevel;
//***********Creation de la map***************
Map Niveau;
Niveau.SetMap(tileset , level , prop , 12 , 12 , x ,y);
//**************Assignation des objects************
Engine Game;
Game.AddObject( Cube);
Game.AffectMap( & Niveau);
EngineControl EScript;
Game.AffectScript(EScript);
Joueur->EC = &EScript;
Game.SetType(1);
Game.Game();
return 1;
}
extern "C"
{
int AddIn_main(int isAppli, unsigned short OptionNum)
{
Menu();
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
}

+ 341
- 0
Menu.cpp
File diff suppressed because it is too large
View File


+ 15
- 0
Menu.hpp View File

@ -0,0 +1,15 @@
#ifndef MENU
#define MENU
#include "..\C-Engine\CHeader.hpp"
#include "Save.hpp"
void Menu();
void SelectLevel(Save * UserSave);
void Info(Save * UserSave);
void SelectCube(Save * UserSave);
void Credit();
void Music();
#endif

+ 97
- 0
Save.cpp View File

@ -0,0 +1,97 @@
#include "..\C-Engine\CHeader.hpp"
#include "Save.hpp"
extern "C"
{
#include "Memory/memory.h"
}
Save::Save()
{
nblevel = 3;
UserInfo = NULL;
TabLevel = NULL;
data = NULL;
lenght = 0;
}
Save::~Save()
{
delete data;
delete UserInfo;
for(int i = 0 ; i < nblevel ; i++)
{
delete TabLevel[i];
}
delete TabLevel;
}
void Save::LoadData()
{
UserInfo = new Info;
TabLevel = new Level*[nblevel];
for(int i = 0 ; i < nblevel ; i++)
{
TabLevel[i] = new Level;
}
if(memory_exists("\\\\fls0\\Dash.sav"))
{
data = (int*)memory_load("\\\\fls0\\Dash.sav");
UserInfo->nbattemp = data[0];
UserInfo->nbjump = data[1];
UserInfo->nbtime = data[2];
UserInfo->completlevel = data[3];
UserInfo->perso = data[4];
for(int i = 0 ; i < nblevel ; i++)
{
TabLevel[i]->normalprogress = data[5 + i * 2];
TabLevel[i]->practiseprogress = data[6 + i * 2];
}
free(data);
}
else
{
UserInfo->nbattemp = 0;
UserInfo->nbjump = 0;
UserInfo->nbtime = 0;
UserInfo->completlevel = 0;
UserInfo->perso = 0;
for(int i = 0 ; i < nblevel ; i++)
{
TabLevel[i]->normalprogress = 0;
TabLevel[i]->practiseprogress = 0;
}
}
}
void Save::SaveData()
{
//Encapssulation des données.
lenght = 5 + nblevel * 2;
data = new int[lenght];
data[0] = UserInfo->nbattemp;
data[1] = UserInfo->nbjump;
data[2] = UserInfo->nbtime;
data[3] = UserInfo->completlevel;
data[4] = UserInfo->perso;
for(int i = 0 ; i < nblevel ; i++)
{
data[5 + i * 2] = TabLevel[i]->normalprogress;
data[6 + i * 2] = TabLevel[i]->practiseprogress;
}
//fin de l'encapssulation.
int error = memory_save("\\\\fls0\\Dash.sav",data,lenght * sizeof (int)); //Sauvegarde
delete data;
}

+ 45
- 0
Save.hpp View File

@ -0,0 +1,45 @@
#ifndef SAVE
#define SAVE
struct Level;
struct Info;
class Save
{
public:
Save();
~Save();
void LoadData();
void SaveData();
Level ** TabLevel;
Info * UserInfo;
int * data;
int lenght;
int nblevel;
};
class Level
{
public:
int normalprogress;
int practiseprogress;
};
class Info
{
public:
int nbattemp;
int nbjump;
int nbtime;
int completlevel;
int perso;
};
#endif

Loading…
Cancel
Save