- [NEW] Módul "info"retocat

This commit is contained in:
2025-07-02 17:15:49 +02:00
parent d7c965ff0b
commit 83cf446c37
17 changed files with 134 additions and 136 deletions

View File

@@ -2,8 +2,7 @@
#include "jgame.h"
#include <stdlib.h>
Momia::Momia( JD8_Surface gfx, Info* info, bool dimoni, Uint16 x, Uint16 y, Prota* sam ) : Sprite( gfx ) {
this->info = info;
Momia::Momia( JD8_Surface gfx, bool dimoni, Uint16 x, Uint16 y, Prota* sam ) : Sprite( gfx ) {
this->dimoni = dimoni;
this->sam = sam;
@@ -16,7 +15,7 @@ Momia::Momia( JD8_Surface gfx, Info* info, bool dimoni, Uint16 x, Uint16 y, Prot
for( int x = 0; x < 5; x++ ) {
this->entitat->frames[frame].w = 15;
this->entitat->frames[frame].h = 15;
if( this->info->num_piramide == 4 ) this->entitat->frames[frame].h -= 5;
if( info::num_piramide == 4 ) this->entitat->frames[frame].h -= 5;
this->entitat->frames[frame].x = (x*15)+75;
if( this->dimoni ) this->entitat->frames[frame].x += 75;
this->entitat->frames[frame].y = 20+(y*15);
@@ -83,7 +82,7 @@ void Momia::draw() {
Sprite::draw();
if( this->info->num_piramide == 4 ) {
if( info::num_piramide == 4 ) {
if( ( JG_GetCycleCounter() % 40 ) < 20 ) {
JD8_BlitCK(this->x, this->y, this->gfx, 220, 80, 15, 15, 255 );
} else {
@@ -104,7 +103,7 @@ bool Momia::update() {
this->engendro = NULL;
}
} else {
if( this->sam->o < 4 && ( this->dimoni || this->info->num_piramide == 5 || JG_GetCycleCounter()%2 == 0 ) ) {
if( this->sam->o < 4 && ( this->dimoni || info::num_piramide == 5 || JG_GetCycleCounter()%2 == 0 ) ) {
if( ( this->x - 20 ) % 65 == 0 && ( this->y - 30 ) % 35 == 0 ) {
if( this->dimoni ) {
@@ -149,8 +148,8 @@ bool Momia::update() {
if( this->sam->pergami ) {
this->sam->pergami = false;
} else {
this->info->vida--;
if( this->info->vida == 0 ) this->sam->o = 5;
info::vida--;
if( info::vida == 0 ) this->sam->o = 5;
}
}
}
@@ -161,7 +160,7 @@ bool Momia::update() {
Momia* seguent = this->next->next;
delete this->next;
this->next = seguent;
this->info->momies--;
info::momies--;
}
}