- [NEW] Módul "info"retocat
This commit is contained in:
@@ -6,18 +6,16 @@
|
||||
#include "jinput.h"
|
||||
#include "jfile.h"
|
||||
|
||||
ModuleGame::ModuleGame( Info* info ) {
|
||||
ModuleGame::ModuleGame() {
|
||||
|
||||
this->info = info;
|
||||
|
||||
this->gfx = JD8_LoadSurface( this->info->pepe_activat ? "frames2.gif" : "frames.gif" );
|
||||
this->gfx = JD8_LoadSurface( info::pepe_activat ? "frames2.gif" : "frames.gif" );
|
||||
JG_SetUpdateTicks(10);
|
||||
|
||||
this->sam = new Prota( this->gfx, this->info );
|
||||
this->mapa = new Mapa( this->gfx, this->info, this->sam );
|
||||
this->marcador = new Marcador( this->gfx, this->info, this->sam );
|
||||
if( this->info->num_piramide == 2 ) {
|
||||
this->bola = new Bola( this->gfx, this->info, this->sam );
|
||||
this->sam = new Prota( this->gfx );
|
||||
this->mapa = new Mapa( this->gfx, this->sam );
|
||||
this->marcador = new Marcador( this->gfx, this->sam );
|
||||
if( info::num_piramide == 2 ) {
|
||||
this->bola = new Bola( this->gfx, this->sam );
|
||||
} else {
|
||||
this->bola = NULL;
|
||||
}
|
||||
@@ -49,7 +47,7 @@ int ModuleGame::Go() {
|
||||
|
||||
this->Draw();
|
||||
|
||||
const char* music = this->info->num_piramide == 3 ? "00000008.ogg" : (this->info->num_piramide == 2 ? "00000007.ogg" : (this->info->num_piramide == 6 ? "00000002.ogg" : "00000006.ogg"));
|
||||
const char* music = info::num_piramide == 3 ? "00000008.ogg" : (info::num_piramide == 2 ? "00000007.ogg" : (info::num_piramide == 6 ? "00000002.ogg" : "00000006.ogg"));
|
||||
const char *current_music = JA_GetMusicFilename();
|
||||
if ( (JA_GetMusicState()!=JA_MUSIC_PLAYING) || !(strcmp(music, current_music) == 0)) {
|
||||
int size;
|
||||
@@ -57,7 +55,7 @@ int ModuleGame::Go() {
|
||||
JA_PlayMusic(JA_LoadMusic((Uint8*)buffer, size, music));
|
||||
}
|
||||
|
||||
JD8_FadeToPal( JD8_LoadPalette(this->info->pepe_activat ? "frames2.gif" : "frames.gif") );
|
||||
JD8_FadeToPal( JD8_LoadPalette(info::pepe_activat ? "frames2.gif" : "frames.gif") );
|
||||
|
||||
while (this->final == 0 && !JG_Quitting()) {
|
||||
|
||||
@@ -68,20 +66,20 @@ int ModuleGame::Go() {
|
||||
//JS_FadeOutMusic();
|
||||
|
||||
if( this->final == 1 ) {
|
||||
this->info->num_habitacio++;
|
||||
if( this->info->num_habitacio == 6 ) {
|
||||
this->info->num_habitacio = 1;
|
||||
this->info->num_piramide++;
|
||||
info::num_habitacio++;
|
||||
if( info::num_habitacio == 6 ) {
|
||||
info::num_habitacio = 1;
|
||||
info::num_piramide++;
|
||||
}
|
||||
if (this->info->num_piramide == 6 && this->info->num_habitacio == 2) this->info->num_piramide++;
|
||||
if (info::num_piramide == 6 && info::num_habitacio == 2) info::num_piramide++;
|
||||
} else if (this->final == 2) {
|
||||
this->info->num_piramide = 100;
|
||||
info::num_piramide = 100;
|
||||
}
|
||||
|
||||
if( JG_Quitting() ) {
|
||||
return -1;
|
||||
} else {
|
||||
if (this->info->num_habitacio == 1 || this->info->num_piramide == 100 || this->info->num_piramide == 7) {
|
||||
if (info::num_habitacio == 1 || info::num_piramide == 100 || info::num_piramide == 7) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
@@ -109,27 +107,27 @@ void ModuleGame::Update() {
|
||||
Momia* seguent = this->momies->next;
|
||||
delete this->momies;
|
||||
this->momies = seguent;
|
||||
this->info->momies--;
|
||||
info::momies--;
|
||||
}
|
||||
if( this->bola != NULL ) this->bola->update();
|
||||
this->mapa->update();
|
||||
if( this->mapa->novaMomia() ) {
|
||||
if( this->momies != NULL ) {
|
||||
this->momies->insertar( new Momia( this->gfx, this->info, true, 0, 0, this->sam ) );
|
||||
this->info->momies++;
|
||||
this->momies->insertar( new Momia( this->gfx, true, 0, 0, this->sam ) );
|
||||
info::momies++;
|
||||
} else {
|
||||
this->momies = new Momia( this->gfx, this->info, true, 0, 0, this->sam );
|
||||
this->info->momies++;
|
||||
this->momies = new Momia( this->gfx, true, 0, 0, this->sam );
|
||||
info::momies++;
|
||||
}
|
||||
}
|
||||
|
||||
if( JI_CheatActivated( "reviu" ) ) this->info->vida = 5;
|
||||
if( JI_CheatActivated( "reviu" ) ) info::vida = 5;
|
||||
if( JI_CheatActivated( "alone" ) ) {
|
||||
if( this->momies != NULL ) {
|
||||
this->momies->clear();
|
||||
delete this->momies;
|
||||
this->momies = NULL;
|
||||
this->info->momies = 0;
|
||||
info::momies = 0;
|
||||
}
|
||||
}
|
||||
if( JI_CheatActivated( "obert" ) ) {
|
||||
@@ -150,17 +148,17 @@ void ModuleGame::Update() {
|
||||
|
||||
void ModuleGame::iniciarMomies() {
|
||||
|
||||
if( this->info->num_habitacio == 1 ) { this->info->momies = 1; } else { this->info->momies++; }
|
||||
if (this->info->num_piramide == 6) this->info->momies = 8;
|
||||
if( info::num_habitacio == 1 ) { info::momies = 1; } else { info::momies++; }
|
||||
if (info::num_piramide == 6) info::momies = 8;
|
||||
|
||||
int x = 20;
|
||||
int y = 170;
|
||||
bool dimonis = this->info->num_piramide == 6;
|
||||
for( int i = 0; i < info->momies; i++ ) {
|
||||
bool dimonis = info::num_piramide == 6;
|
||||
for( int i = 0; i < info::momies; i++ ) {
|
||||
if( this->momies == NULL) {
|
||||
this->momies = new Momia( this->gfx, this->info, dimonis, x, y, this->sam );
|
||||
this->momies = new Momia( this->gfx, dimonis, x, y, this->sam );
|
||||
} else {
|
||||
this->momies->insertar( new Momia( this->gfx, this->info, dimonis, x, y, this->sam ) );
|
||||
this->momies->insertar( new Momia( this->gfx, dimonis, x, y, this->sam ) );
|
||||
}
|
||||
x += 65;
|
||||
if( x == 345 ) { x = 20; y -= 35; }
|
||||
|
||||
Reference in New Issue
Block a user