Compare commits
117 Commits
4cd02fe5dc
...
v1.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 8df6a82b80 | |||
| 7e84495701 | |||
| 0981882fd3 | |||
| 8c4233e90e | |||
| f3f4639abe | |||
| 60a0ca2b0e | |||
| f21a4808f5 | |||
| 283f3f58f5 | |||
| 7cbf75ffd9 | |||
| 2bfe750ccc | |||
| 438e24ab9e | |||
| ccc4f760b2 | |||
| fd2b90fb3b | |||
| f8b42bc986 | |||
| f638d4e262 | |||
| 3a0cba54ba | |||
| e30bbc5f8c | |||
| a69aa23490 | |||
| 24f693e357 | |||
| 773b59be23 | |||
| 21b449ba45 | |||
| 7364890a9d | |||
| 185ee3797d | |||
| cc862d2952 | |||
| 76b440667b | |||
| ef93f2c3df | |||
| 8a0318b852 | |||
| 79e1d793e2 | |||
| 851513f1d9 | |||
| 6d9c902f2d | |||
| 66fee27b50 | |||
| 6b63dbd70a | |||
| 136bc86f68 | |||
| 61b429eb8b | |||
| 5dcf2e582a | |||
| 448ffa3597 | |||
| b59e3bdd40 | |||
| 07d2f8b721 | |||
| e2187ffd5b | |||
| 98138344e6 | |||
| 6472845333 | |||
| f9d2ac66e8 | |||
| 0b80fc1674 | |||
| d8404ce752 | |||
| d391827fe1 | |||
| 8d954ec2e0 | |||
| 720c15d03a | |||
| ccb2f3fbca | |||
| ad1cceea5f | |||
| 70720e7e62 | |||
| 490dc1e5d6 | |||
| 5173edd7f0 | |||
| c9e1760698 | |||
| c5499bf549 | |||
| 6b8a5213e6 | |||
| 8cb28f000d | |||
| d237dd2019 | |||
| c6b994cc37 | |||
| fdc604be3c | |||
| 3f203fee62 | |||
| 771e7abb65 | |||
| 8918c25b4e | |||
| bcd38a5a06 | |||
| c1bbcace85 | |||
| 11d3309c82 | |||
| aa6b79c9ac | |||
| 4c430ec512 | |||
| 262761e832 | |||
| 2a795122f2 | |||
| cee7c19832 | |||
| 1967cc33db | |||
| 04933642ae | |||
| ea83c48a17 | |||
| 3db23c32ed | |||
| dbd4912b04 | |||
| b3d0a10a23 | |||
| 273a672542 | |||
| 572dff8dbb | |||
| 6e3a0e513e | |||
| 907fccf69c | |||
| 6140e13db6 | |||
| ece24d4562 | |||
| 1fd9d919c5 | |||
| a9357c6638 | |||
| d20bc2ef73 | |||
| 13ba26fb0e | |||
| f9103548cf | |||
| c905e5be1f | |||
| c3bfc83689 | |||
| e8a5c033bb | |||
| a1d3209dd3 | |||
| 1309e5d7d8 | |||
| 183c095f6d | |||
| 9f623b249f | |||
| 5cb9caa966 | |||
| ea618d6e7e | |||
| 74eb5ede58 | |||
| 65589d6ff1 | |||
| 83e5234cb6 | |||
| 5cb0200b9f | |||
| 6a46966fe4 | |||
| 4a8505298b | |||
| cbbe4951bb | |||
| 65c4ef39a7 | |||
| 53dec7dfeb | |||
| 58c229c08c | |||
| 7b40d4fad4 | |||
| eb5e2abf75 | |||
| d33db04d3b | |||
| d3f413ebbb | |||
| e00e94ce15 | |||
| 20df5d3935 | |||
| 20cf3656f6 | |||
| 2ad5241005 | |||
| 717c5715e9 | |||
| f8f181bd33 | |||
| 6fb53a6435 |
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
.vscode/*
|
||||
*.exe
|
||||
arounders
|
||||
arounders_debug
|
||||
./*.dll
|
||||
release/*
|
||||
@@ -1,47 +0,0 @@
|
||||
#include "AiguaProcesor.h"
|
||||
|
||||
AiguaProcesor::AiguaProcesor(DrawManager *p_drawManager, int p_fase)
|
||||
{
|
||||
drawManager = p_drawManager;
|
||||
fase = p_fase;
|
||||
|
||||
grafic = drawManager->LoadFont("aigua.gif");
|
||||
frame1 = 0;
|
||||
frame2 = 5;
|
||||
}
|
||||
|
||||
AiguaProcesor::~AiguaProcesor(void)
|
||||
{
|
||||
SDL_FreeSurface(grafic);
|
||||
}
|
||||
|
||||
void AiguaProcesor::Pintar() {
|
||||
int frames1[10] = {0,1,2,1,0,3,4,5,4,3};
|
||||
int frames2[10] = {6,7,8,7,6,9,10,11,10,9};
|
||||
int *frames;
|
||||
if ((fase+1) % 5 == 0) {
|
||||
frames = frames2;
|
||||
} else {
|
||||
frames = frames1;
|
||||
}
|
||||
|
||||
SDL_Rect clip;
|
||||
clip.y = 0;
|
||||
clip.w = 16;
|
||||
clip.h = 15;
|
||||
|
||||
for (int i=0;i<10;i++) {
|
||||
clip.x = frames[frame1]*16;
|
||||
drawManager->Blit(i*32, 150, grafic, &clip);
|
||||
clip.x = frames[frame2]*16;
|
||||
drawManager->Blit(16+i*32, 150, grafic, &clip);
|
||||
}
|
||||
}
|
||||
|
||||
void AiguaProcesor::Procesar() {
|
||||
frame1++;
|
||||
frame2++;
|
||||
|
||||
if (frame1 == 10) frame1 = 0;
|
||||
if (frame2 == 10) frame2 = 0;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
#include "DrawManager.h"
|
||||
|
||||
class AiguaProcesor
|
||||
{
|
||||
public:
|
||||
AiguaProcesor(DrawManager *p_drawManager, int p_fase);
|
||||
~AiguaProcesor(void);
|
||||
|
||||
void Pintar();
|
||||
void Procesar();
|
||||
|
||||
private:
|
||||
DrawManager *drawManager;
|
||||
|
||||
SDL_Surface *grafic;
|
||||
int frame1;
|
||||
int frame2;
|
||||
int fase;
|
||||
};
|
||||
@@ -1,101 +0,0 @@
|
||||
#include <string>
|
||||
#include "AppController.h"
|
||||
#include "SequenceController.h"
|
||||
#include "MenuController.h"
|
||||
#include "PasswordController.h"
|
||||
#include "PrefaseController.h"
|
||||
#include "GameController.h"
|
||||
#include "PostfaseController.h"
|
||||
#include "MortController.h"
|
||||
#include "const.h"
|
||||
|
||||
AppController::AppController(int pMode)
|
||||
{
|
||||
gameInfo = new GameInfo(pMode);
|
||||
}
|
||||
|
||||
AppController::~AppController(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool AppController::Init(void)
|
||||
{
|
||||
if( SDL_Init( SDL_INIT_EVERYTHING ) == -1 ) { return false; }
|
||||
|
||||
drawManager = new DrawManager(gameInfo->modeGrafic);
|
||||
inputManager = new InputManager(gameInfo);
|
||||
musicManager = new MusicManager();
|
||||
|
||||
if ( !drawManager->Init() ) { return false; }
|
||||
musicManager->Init();
|
||||
|
||||
SDL_WM_SetCaption( APPLICATION_NAME, NULL );
|
||||
|
||||
SDL_ShowCursor(0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AppController::Go()
|
||||
{
|
||||
if (!Init()) gameInfo->estado = ESTADO_SALIR;
|
||||
|
||||
while ( gameInfo->estado != ESTADO_SALIR ) {
|
||||
switch ( gameInfo->estado ) {
|
||||
case ESTADO_SEQUENCIA:
|
||||
SequenceController *sequenceController;
|
||||
sequenceController = new SequenceController(drawManager, inputManager, musicManager);
|
||||
sequenceController->Go(gameInfo);
|
||||
delete sequenceController;
|
||||
break;
|
||||
case ESTADO_MENU:
|
||||
MenuController *menuController;
|
||||
menuController = new MenuController(drawManager, inputManager, musicManager);
|
||||
menuController->Go(gameInfo);
|
||||
delete menuController;
|
||||
break;
|
||||
case ESTADO_PASSWORD:
|
||||
PasswordController *passwordController;
|
||||
passwordController = new PasswordController(drawManager, inputManager, musicManager);
|
||||
passwordController->Go(gameInfo);
|
||||
delete passwordController;
|
||||
break;
|
||||
case ESTADO_PREFASE:
|
||||
PrefaseController *prefaseController;
|
||||
prefaseController = new PrefaseController(drawManager, inputManager, musicManager);
|
||||
prefaseController->Go(gameInfo);
|
||||
delete prefaseController;
|
||||
break;
|
||||
case ESTADO_JUEGO:
|
||||
GameController *gameController;
|
||||
gameController = new GameController(drawManager, inputManager, musicManager);
|
||||
gameController->Go(gameInfo);
|
||||
delete gameController;
|
||||
break;
|
||||
case ESTADO_POSTFASE:
|
||||
PostfaseController *postfaseController;
|
||||
postfaseController = new PostfaseController(drawManager, inputManager, musicManager);
|
||||
postfaseController->Go(gameInfo);
|
||||
delete postfaseController;
|
||||
break;
|
||||
case ESTADO_MORT:
|
||||
MortController *mortController;
|
||||
mortController = new MortController(drawManager, inputManager, musicManager);
|
||||
mortController->Go(gameInfo);
|
||||
delete mortController;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Finalize();
|
||||
}
|
||||
|
||||
void AppController::Finalize(void)
|
||||
{
|
||||
delete drawManager;
|
||||
delete inputManager;
|
||||
delete musicManager;
|
||||
delete gameInfo;
|
||||
|
||||
SDL_Quit();
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#pragma once
|
||||
#include "SDL/SDL.h"
|
||||
#include "DrawManager.h"
|
||||
#include "InputManager.h"
|
||||
#include "MusicManager.h"
|
||||
#include "GameInfo.h"
|
||||
|
||||
class AppController
|
||||
{
|
||||
public:
|
||||
AppController(int pMode);
|
||||
~AppController(void);
|
||||
|
||||
void Go();
|
||||
|
||||
private:
|
||||
bool Init(void);
|
||||
void Finalize(void);
|
||||
|
||||
DrawManager *drawManager;
|
||||
InputManager *inputManager;
|
||||
MusicManager *musicManager;
|
||||
GameInfo *gameInfo;
|
||||
|
||||
};
|
||||
@@ -1,818 +0,0 @@
|
||||
#include "ArounderProcesor.h"
|
||||
|
||||
ArounderProcesor::ArounderProcesor(DrawManager *pDrawManager, MarcadorProcesor *pMarcadorProcesor, SDL_Surface *pSprites, SDL_Surface *pMapa, int pxInicial, int pyInicial, int pxFinal, int pyFinal )
|
||||
{
|
||||
drawManager = pDrawManager;
|
||||
marcadorProcesor = pMarcadorProcesor;
|
||||
sprites = pSprites;
|
||||
mapa = pMapa;
|
||||
pixels = (Uint32 *)mapa->pixels;
|
||||
explosio = drawManager->LoadMask("explosio.gif");
|
||||
|
||||
xInicial = pxInicial;
|
||||
yInicial = pyInicial;
|
||||
xFinal = pxFinal;
|
||||
yFinal = pyFinal;
|
||||
|
||||
X = xInicial;
|
||||
Y = yInicial;
|
||||
O = marcadorProcesor->orientacioInicial;
|
||||
frame = 0;
|
||||
frameX = 0;
|
||||
frameY = 0;
|
||||
altura = 0;
|
||||
|
||||
accio = ACCIO_CAMINAR;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
|
||||
clip.w = 8;
|
||||
clip.h = 8;
|
||||
|
||||
siguiente = NULL;
|
||||
anterior = NULL;
|
||||
|
||||
colorEscalo = SDL_MapRGB( mapa->format, 60, 0, 60 );
|
||||
colorCorda = SDL_MapRGB( mapa->format, 255, 251, 194 );
|
||||
}
|
||||
|
||||
ArounderProcesor::~ArounderProcesor(void)
|
||||
{
|
||||
if (anterior != NULL) anterior->siguiente = siguiente;
|
||||
if (siguiente != NULL) siguiente->anterior = anterior;
|
||||
|
||||
SDL_FreeSurface(explosio);
|
||||
}
|
||||
|
||||
ArounderProcesor *ArounderProcesor::Afegir() {
|
||||
if (siguiente != NULL) {
|
||||
return siguiente->Afegir();
|
||||
} else {
|
||||
siguiente = new ArounderProcesor(drawManager, marcadorProcesor, sprites, mapa, xInicial, yInicial, xFinal, yFinal);
|
||||
siguiente->anterior = this;
|
||||
return siguiente;
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::Pintar() {
|
||||
clip.y = frameY;
|
||||
clip.x = frameX*8;
|
||||
drawManager->Blit(X, Y, sprites, &clip);
|
||||
|
||||
if (siguiente != NULL) siguiente->Pintar();
|
||||
}
|
||||
|
||||
ArounderProcesor *ArounderProcesor::Seleccionar(int mouseX, int mouseY) {
|
||||
if (X <= mouseX && (X+8) >= mouseX && Y <= mouseY && (Y+8) >= mouseY) {
|
||||
return this;
|
||||
} else {
|
||||
if (siguiente != NULL) {
|
||||
return siguiente->Seleccionar(mouseX, mouseY);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::Procesar() {
|
||||
|
||||
switch(accio) {
|
||||
case ACCIO_CAMINAR:
|
||||
procesarCaminar();
|
||||
break;
|
||||
case ACCIO_CAURE:
|
||||
procesarCaure();
|
||||
break;
|
||||
case ACCIO_CAVAR:
|
||||
procesarCavar();
|
||||
break;
|
||||
case ACCIO_ESCALAR:
|
||||
procesarEscalar();
|
||||
break;
|
||||
case ACCIO_PERFORAR:
|
||||
procesarPerforar();
|
||||
break;
|
||||
case ACCIO_ESCALERA:
|
||||
procesarEscalera();
|
||||
break;
|
||||
case ACCIO_PASARELA:
|
||||
procesarPasarela();
|
||||
break;
|
||||
case ACCIO_CORDA:
|
||||
procesarCorda();
|
||||
break;
|
||||
case ACCIO_PUJARCORDA:
|
||||
procesarPujarCorda();
|
||||
break;
|
||||
case ACCIO_BAIXARCORDA:
|
||||
procesarBaixarCorda();
|
||||
break;
|
||||
case ACCIO_SUICIDI:
|
||||
procesarSuicidi();
|
||||
break;
|
||||
}
|
||||
|
||||
if (X == xFinal && Y == yFinal) initArrivat();
|
||||
|
||||
if (siguiente != NULL) siguiente->Procesar();
|
||||
}
|
||||
|
||||
void ArounderProcesor::AbortarAccio() {
|
||||
if (accio == ACCIO_ESCALAR) {
|
||||
if (O == ORIENT_DRETA) X=X-5; else X=X+5;
|
||||
}
|
||||
if (accio != ACCIO_CAMINAR && accio != ACCIO_CAURE && accio != ACCIO_PUJARCORDA && accio != ACCIO_BAIXARCORDA) {
|
||||
accio = ACCIO_CAMINAR;
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::initMort() {
|
||||
accio = ACCIO_MORT;
|
||||
drawManager->apply_surface(X-9, Y-12, explosio, mapa);
|
||||
marcadorProcesor->numAroundersMorts++;
|
||||
}
|
||||
|
||||
void ArounderProcesor::initArrivat() {
|
||||
accio = ACCIO_MORT;
|
||||
marcadorProcesor->numAroundersArrivats++;
|
||||
}
|
||||
|
||||
void ArounderProcesor::initCaminar() {
|
||||
frame = 0;
|
||||
accio = ACCIO_CAMINAR;
|
||||
procesarCaminar();
|
||||
}
|
||||
|
||||
void ArounderProcesor::initCaure() {
|
||||
frame = 0;
|
||||
accio = ACCIO_CAURE;
|
||||
altura = 0;
|
||||
procesarCaure();
|
||||
}
|
||||
|
||||
void ArounderProcesor::initParar() {
|
||||
if (marcadorProcesor->numParar > 0) {
|
||||
frame = 0;
|
||||
accio = ACCIO_PARAR;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
marcadorProcesor->numParar--;
|
||||
procesarParar();
|
||||
} else {
|
||||
frame = 0;
|
||||
accio = ACCIO_CAMINAR;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
procesarCaminar();
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::initCavar() {
|
||||
if (marcadorProcesor->numCavar > 0) {
|
||||
frame = 0;
|
||||
accio = ACCIO_CAVAR;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
marcadorProcesor->numCavar--;
|
||||
procesarCavar();
|
||||
} else {
|
||||
frame = 0;
|
||||
accio = ACCIO_CAMINAR;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
procesarCaminar();
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::initEscalar() {
|
||||
if (marcadorProcesor->numEscalar > 0) {
|
||||
frame = 0;
|
||||
accio = ACCIO_ESCALAR;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
marcadorProcesor->numEscalar--;
|
||||
if (O == ORIENT_DRETA) {
|
||||
X = X + 5;
|
||||
} else {
|
||||
X = X - 5;
|
||||
}
|
||||
procesarEscalar();
|
||||
} else {
|
||||
frame = 0;
|
||||
accio = ACCIO_CAMINAR;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
procesarCaminar();
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::initPerforar() {
|
||||
if (marcadorProcesor->numPerforar > 0) {
|
||||
frame = 0;
|
||||
accio = ACCIO_PERFORAR;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
marcadorProcesor->numPerforar--;
|
||||
procesarPerforar();
|
||||
} else {
|
||||
frame = 0;
|
||||
accio = ACCIO_CAMINAR;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
procesarCaminar();
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::initEscalera() {
|
||||
frame = 0;
|
||||
accio = ACCIO_ESCALERA;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
procesarEscalera();
|
||||
}
|
||||
|
||||
void ArounderProcesor::initPasarela() {
|
||||
frame = 0;
|
||||
accio = ACCIO_PASARELA;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
procesarPasarela();
|
||||
}
|
||||
|
||||
void ArounderProcesor::initCorda() {
|
||||
if (marcadorProcesor->numCorda > 0) {
|
||||
frame = 0;
|
||||
accio = ACCIO_CORDA;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
marcadorProcesor->numCorda--;
|
||||
procesarCorda();
|
||||
altura = 0;
|
||||
} else {
|
||||
frame = 0;
|
||||
accio = ACCIO_CAMINAR;
|
||||
prevista = ACCIO_CAMINAR;
|
||||
procesarCaminar();
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::initPujarCorda() {
|
||||
frame = 0;
|
||||
accio = ACCIO_PUJARCORDA;
|
||||
if (O == ORIENT_DRETA) {
|
||||
X = X + 3;
|
||||
} else {
|
||||
X = X - 3;
|
||||
}
|
||||
procesarPujarCorda();
|
||||
}
|
||||
|
||||
void ArounderProcesor::initBaixarCorda() {
|
||||
frame = 0;
|
||||
accio = ACCIO_BAIXARCORDA;
|
||||
if (O == ORIENT_DRETA) {
|
||||
X = X + 2;
|
||||
} else {
|
||||
X = X - 2;
|
||||
}
|
||||
procesarBaixarCorda();
|
||||
}
|
||||
|
||||
void ArounderProcesor::initSuicidi() {
|
||||
frame = 0;
|
||||
accio = ACCIO_SUICIDI;
|
||||
prevista = accio;
|
||||
procesarSuicidi();
|
||||
}
|
||||
|
||||
|
||||
void ArounderProcesor::procesarCaminar() {
|
||||
const int frames[4] = {3,4,3,5};
|
||||
frame++;
|
||||
if (frame >= 4) frame = 0;
|
||||
frameX = frames[frame];
|
||||
frameY = O;
|
||||
|
||||
if (blockCaure()) {
|
||||
initCaure();
|
||||
} else {
|
||||
switch ( prevista ) {
|
||||
case ACCIO_PARAR:
|
||||
initParar();
|
||||
break;
|
||||
case ACCIO_PERFORAR:
|
||||
initPerforar();
|
||||
break;
|
||||
case ACCIO_ESCALERA:
|
||||
initEscalera();
|
||||
break;
|
||||
case ACCIO_SUICIDI:
|
||||
initSuicidi();
|
||||
break;
|
||||
default:
|
||||
if (blockCordaPujar()) {
|
||||
initPujarCorda();
|
||||
} else if (blockCaminar()) {
|
||||
if (prevista == ACCIO_CAVAR) {
|
||||
initCavar();
|
||||
} else if (prevista == ACCIO_ESCALAR) {
|
||||
initEscalar();
|
||||
} else {
|
||||
O = O ^ ORIENT_ESQUERRA;
|
||||
}
|
||||
} else {
|
||||
if (blockArounder()) {
|
||||
O = O ^ ORIENT_ESQUERRA;
|
||||
} else {
|
||||
if (blockPrecipici() && (prevista == ACCIO_PASARELA || prevista == ACCIO_CORDA)) {
|
||||
if (prevista == ACCIO_PASARELA) {
|
||||
initPasarela();
|
||||
} else {
|
||||
initCorda();
|
||||
}
|
||||
} else {
|
||||
if (blockCordaBaixar()) {
|
||||
initBaixarCorda();
|
||||
} else if (blockCordaPujar()) {
|
||||
initPujarCorda();
|
||||
} else {
|
||||
if (pujarEscalo()) Y--;
|
||||
X+= ((((O ^ 8) << 1) >> 3) - 1);
|
||||
if (baixarEscalo()) Y++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarCaure() {
|
||||
frame = 0;
|
||||
frameX = 11;
|
||||
frameY = O;
|
||||
|
||||
if (!blockCaure()) {
|
||||
if (altura >= 32) {
|
||||
initMort();
|
||||
} else {
|
||||
initCaminar();
|
||||
}
|
||||
} else {
|
||||
if (Y > 151) {
|
||||
initMort();
|
||||
} else {
|
||||
Y++;
|
||||
altura++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarParar() {
|
||||
frame = 0;
|
||||
frameX = 2;
|
||||
frameY = 8;
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarCavar() {
|
||||
const int frames[3] = {6,7,8};
|
||||
frame++;
|
||||
if (frame == 3) frame = 0;
|
||||
frameX = frames[frame];
|
||||
frameY = O;
|
||||
|
||||
if (blockCaure()) {
|
||||
initCaure();
|
||||
} else {
|
||||
if (!blockCaminar()) {
|
||||
initCaminar();
|
||||
} else {
|
||||
if (frame == 2) {
|
||||
doCavar();
|
||||
if (O == ORIENT_DRETA) {
|
||||
X++;
|
||||
} else {
|
||||
X--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarEscalar() {
|
||||
const int frames[2] = {9,10};
|
||||
frame++;
|
||||
if (frame == 2) frame = 0;
|
||||
frameX = frames[frame];
|
||||
frameY = O;
|
||||
|
||||
if (!blockParet(5)) {
|
||||
if (O == ORIENT_DRETA) {
|
||||
X = X - 1;
|
||||
} else {
|
||||
X = X + 1;
|
||||
}
|
||||
Y=Y-1;
|
||||
initCaminar();
|
||||
} else {
|
||||
if (blockTecho(5)) {
|
||||
if (O == ORIENT_DRETA) {
|
||||
X = X - 5;
|
||||
} else {
|
||||
X = X + 5;
|
||||
}
|
||||
initCaminar();
|
||||
} else {
|
||||
Y--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarPerforar() {
|
||||
const int frames[2] = {0,1};
|
||||
frame++;
|
||||
if (frame == 2) frame = 0;
|
||||
frameX = frames[frame];
|
||||
frameY = 8;
|
||||
|
||||
if (blockCaure()) {
|
||||
initCaure();
|
||||
} else {
|
||||
if (frame == 1) {
|
||||
doPerforar();
|
||||
Y++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarEscalera() {
|
||||
const int frames[5] = {12,13,14,15,4};
|
||||
frame++;
|
||||
if (frame == 5) frame = 0;
|
||||
frameX = frames[frame];
|
||||
frameY = O;
|
||||
|
||||
if (blockParet() || blockTecho() || marcadorProcesor->numEscalera == 0) {
|
||||
initCaminar();
|
||||
} else {
|
||||
if (frame == 3) {
|
||||
doEscalera();
|
||||
marcadorProcesor->numEscalera--;
|
||||
}
|
||||
if (frame == 4) {
|
||||
Y--;
|
||||
if (O == ORIENT_DRETA) {
|
||||
X++;
|
||||
} else {
|
||||
X--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarPasarela() {
|
||||
const int frames[5] = {12,13,14,15,4};
|
||||
frame++;
|
||||
if (frame == 5) frame = 0;
|
||||
frameX = frames[frame];
|
||||
frameY = O;
|
||||
|
||||
if (blockParet() || !blockPrecipiciPasarela() || marcadorProcesor->numPasarela == 0) {
|
||||
initCaminar();
|
||||
} else {
|
||||
if (frame == 3) {
|
||||
doEscalera(1);
|
||||
marcadorProcesor->numPasarela--;
|
||||
}
|
||||
if (frame == 4) {
|
||||
if (O == ORIENT_DRETA) {
|
||||
X=X+2;
|
||||
} else {
|
||||
X=X-2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarCorda() {
|
||||
const int frames[4] = {12,13,14,15};
|
||||
if (frame < 3) frame++;
|
||||
frameX = frames[frame];
|
||||
frameY = O;
|
||||
|
||||
if (frame == 3 ) {
|
||||
if (!blockNovaCorda()) {
|
||||
initCaminar();
|
||||
} else {
|
||||
doCorda();
|
||||
altura++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarPujarCorda() {
|
||||
const int frames[2] = {9,10};
|
||||
frame++;
|
||||
if (frame == 2) frame = 0;
|
||||
frameX = frames[frame];
|
||||
frameY = O;
|
||||
|
||||
if (!blockCordaPujar(3)) {
|
||||
Y = Y - 2;
|
||||
initCaminar();
|
||||
} else {
|
||||
if (blockTecho(3)) {
|
||||
if (O == ORIENT_DRETA) {
|
||||
X = X - 3;
|
||||
} else {
|
||||
X = X + 3;
|
||||
}
|
||||
initCaminar();
|
||||
} else {
|
||||
Y--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarBaixarCorda() {
|
||||
const int frames[2] = {9,10};
|
||||
frame++;
|
||||
if (frame == 2) frame = 0;
|
||||
frameX = frames[frame];
|
||||
frameY = ORIENT_ESQUERRA - O;
|
||||
|
||||
if (!blockCordaBaixar(2)) {
|
||||
initCaminar();
|
||||
} else {
|
||||
if (!blockCaure(3)) {
|
||||
if (O == ORIENT_DRETA) {
|
||||
X = X - 2;
|
||||
} else {
|
||||
X = X + 2;
|
||||
}
|
||||
initCaminar();
|
||||
} else {
|
||||
Y++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::procesarSuicidi() {
|
||||
const int frames[5] = {0,1,2,1,2};
|
||||
frameX = frames[frame];
|
||||
frameY = 0;
|
||||
|
||||
if (frame == 4) initMort();
|
||||
frame++;
|
||||
}
|
||||
|
||||
bool ArounderProcesor::blockCaure(int desfase) {
|
||||
if ( O == ORIENT_ESQUERRA) desfase = -desfase;
|
||||
return ( (get_pixel(X+desfase , Y+8) == 0 || get_pixel(X+desfase , Y+8) == colorCorda) &&
|
||||
(get_pixel(X+desfase+1, Y+8) == 0 || get_pixel(X+desfase+1, Y+8) == colorCorda) &&
|
||||
(get_pixel(X+desfase+2, Y+8) == 0 || get_pixel(X+desfase+2, Y+8) == colorCorda) &&
|
||||
(get_pixel(X+desfase+3, Y+8) == 0 || get_pixel(X+desfase+3, Y+8) == colorCorda) &&
|
||||
(get_pixel(X+desfase+4, Y+8) == 0 || get_pixel(X+desfase+4, Y+8) == colorCorda) &&
|
||||
(get_pixel(X+desfase+5, Y+8) == 0 || get_pixel(X+desfase+5, Y+8) == colorCorda) &&
|
||||
(get_pixel(X+desfase+6, Y+8) == 0 || get_pixel(X+desfase+6, Y+8) == colorCorda) &&
|
||||
(get_pixel(X+desfase+7, Y+8) == 0 || get_pixel(X+desfase+7, Y+8) == colorCorda) &&
|
||||
(get_pixel(X+desfase , Y+9) == 0 || get_pixel(X+desfase , Y+9) == colorCorda) &&
|
||||
(get_pixel(X+desfase+1, Y+9) == 0 || get_pixel(X+desfase+1, Y+9) == colorCorda) &&
|
||||
(get_pixel(X+desfase+2, Y+9) == 0 || get_pixel(X+desfase+2, Y+9) == colorCorda) &&
|
||||
(get_pixel(X+desfase+3, Y+9) == 0 || get_pixel(X+desfase+3, Y+9) == colorCorda) &&
|
||||
(get_pixel(X+desfase+4, Y+9) == 0 || get_pixel(X+desfase+4, Y+9) == colorCorda) &&
|
||||
(get_pixel(X+desfase+5, Y+9) == 0 || get_pixel(X+desfase+5, Y+9) == colorCorda) &&
|
||||
(get_pixel(X+desfase+6, Y+9) == 0 || get_pixel(X+desfase+6, Y+9) == colorCorda) &&
|
||||
(get_pixel(X+desfase+7, Y+9) == 0 || get_pixel(X+desfase+7, Y+9) == colorCorda)
|
||||
);
|
||||
}
|
||||
|
||||
bool ArounderProcesor::baixarEscalo() {
|
||||
return ( get_pixel(X , Y+8) == 0 &&
|
||||
get_pixel(X+1, Y+8) == 0 &&
|
||||
get_pixel(X+2, Y+8) == 0 &&
|
||||
get_pixel(X+3, Y+8) == 0 &&
|
||||
get_pixel(X+4, Y+8) == 0 &&
|
||||
get_pixel(X+5, Y+8) == 0 &&
|
||||
get_pixel(X+6, Y+8) == 0 &&
|
||||
get_pixel(X+7, Y+8) == 0 &&
|
||||
|
||||
( get_pixel(X , Y+9) != 0 ||
|
||||
get_pixel(X+1, Y+9) != 0 ||
|
||||
get_pixel(X+2, Y+9) != 0 ||
|
||||
get_pixel(X+3, Y+9) != 0 ||
|
||||
get_pixel(X+4, Y+9) != 0 ||
|
||||
get_pixel(X+5, Y+9) != 0 ||
|
||||
get_pixel(X+6, Y+9) != 0 ||
|
||||
get_pixel(X+7, Y+9) != 0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
bool ArounderProcesor::blockCaminar() {
|
||||
if (O == ORIENT_DRETA) {
|
||||
return (get_pixel(X+8, Y+6) != 0 && get_pixel(X+8, Y+7) != 0 && get_pixel(X+8, Y+6) != colorEscalo);
|
||||
} else {
|
||||
return (get_pixel(X-1, Y+6) != 0 && get_pixel(X-1, Y+7) != 0 && get_pixel(X-1, Y+6) != colorEscalo);
|
||||
}
|
||||
}
|
||||
|
||||
bool ArounderProcesor::pujarEscalo() {
|
||||
if (O == ORIENT_DRETA) {
|
||||
return ( (get_pixel(X+8, Y+6) == 0 || get_pixel(X+8, Y+6) == colorEscalo) && get_pixel(X+8, Y+7) != 0);
|
||||
} else {
|
||||
return ( (get_pixel(X-1, Y+6) == 0 || get_pixel(X-1, Y+6) == colorEscalo) && get_pixel(X-1, Y+7) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool ArounderProcesor::blockArounder() {
|
||||
bool resultado = false;
|
||||
if (anterior != NULL) resultado = anterior->checkArounderAnt(X, Y, O);
|
||||
if (siguiente != NULL) resultado = resultado || siguiente->checkArounderSig(X, Y, O);
|
||||
|
||||
return resultado;
|
||||
}
|
||||
|
||||
bool ArounderProcesor::blockParet(int desfase) {
|
||||
if (O == ORIENT_DRETA) {
|
||||
return (get_pixel(X+8-desfase, Y ) != 0 ||
|
||||
get_pixel(X+8-desfase, Y+1) != 0 ||
|
||||
get_pixel(X+8-desfase, Y+2) != 0 ||
|
||||
get_pixel(X+8-desfase, Y+3) != 0 ||
|
||||
get_pixel(X+8-desfase, Y+4) != 0 ||
|
||||
get_pixel(X+8-desfase, Y+5) != 0 ||
|
||||
get_pixel(X+8-desfase, Y+6) != 0// ||
|
||||
//get_pixel(X+8-desfase, Y+7) != 0
|
||||
);
|
||||
} else {
|
||||
return (get_pixel(X-1+desfase, Y ) != 0 ||
|
||||
get_pixel(X-1+desfase, Y+1) != 0 ||
|
||||
get_pixel(X-1+desfase, Y+2) != 0 ||
|
||||
get_pixel(X-1+desfase, Y+3) != 0 ||
|
||||
get_pixel(X-1+desfase, Y+4) != 0 ||
|
||||
get_pixel(X-1+desfase, Y+5) != 0 ||
|
||||
get_pixel(X-1+desfase, Y+6) != 0// ||
|
||||
//get_pixel(X-1+desfase, Y+7) != 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
bool ArounderProcesor::blockTecho(int desfase) {
|
||||
if ( O == ORIENT_DRETA) desfase = -desfase;
|
||||
|
||||
return ( (get_pixel(X+desfase , Y-1) != 0 && get_pixel(X+desfase , Y-1) != colorCorda) ||
|
||||
(get_pixel(X+desfase+1, Y-1) != 0 && get_pixel(X+desfase+1, Y-1) != colorCorda) ||
|
||||
(get_pixel(X+desfase+2, Y-1) != 0 && get_pixel(X+desfase+2, Y-1) != colorCorda) ||
|
||||
(get_pixel(X+desfase+3, Y-1) != 0 && get_pixel(X+desfase+3, Y-1) != colorCorda) ||
|
||||
(get_pixel(X+desfase+4, Y-1) != 0 && get_pixel(X+desfase+4, Y-1) != colorCorda) ||
|
||||
(get_pixel(X+desfase+5, Y-1) != 0 && get_pixel(X+desfase+5, Y-1) != colorCorda) ||
|
||||
(get_pixel(X+desfase+6, Y-1) != 0 && get_pixel(X+desfase+6, Y-1) != colorCorda) ||
|
||||
(get_pixel(X+desfase+7, Y-1) != 0 && get_pixel(X+desfase+7, Y-1) != colorCorda)
|
||||
);
|
||||
}
|
||||
|
||||
bool ArounderProcesor::blockPrecipici() {
|
||||
if (O == ORIENT_DRETA) {
|
||||
return (get_pixel(X+7, Y+8) == 0 &&
|
||||
get_pixel(X+6, Y+8) == 0 &&
|
||||
get_pixel(X+5, Y+8) == 0 &&
|
||||
get_pixel(X+7, Y+9) == 0 &&
|
||||
get_pixel(X+6, Y+9) == 0 &&
|
||||
get_pixel(X+5, Y+9) == 0
|
||||
);
|
||||
} else {
|
||||
return (get_pixel(X , Y+8) == 0 &&
|
||||
get_pixel(X+1, Y+8) == 0 &&
|
||||
get_pixel(X+2, Y+8) == 0 &&
|
||||
get_pixel(X , Y+9) == 0 &&
|
||||
get_pixel(X+1, Y+9) == 0 &&
|
||||
get_pixel(X+2, Y+9) == 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
bool ArounderProcesor::blockPrecipiciPasarela() {
|
||||
if (O == ORIENT_DRETA) {
|
||||
return ((get_pixel(X+7, Y+8) == 0 || get_pixel(X+7, Y+8) == colorEscalo) &&
|
||||
(get_pixel(X+6, Y+8) == 0 || get_pixel(X+6, Y+8) == colorEscalo) &&
|
||||
(get_pixel(X+5, Y+8) == 0 || get_pixel(X+5, Y+8) == colorEscalo) &&
|
||||
(get_pixel(X+7, Y+9) == 0 || get_pixel(X+7, Y+9) == colorEscalo) &&
|
||||
(get_pixel(X+6, Y+9) == 0 || get_pixel(X+6, Y+9) == colorEscalo) &&
|
||||
(get_pixel(X+5, Y+9) == 0 || get_pixel(X+5, Y+9) == colorEscalo)
|
||||
);
|
||||
} else {
|
||||
return ((get_pixel(X , Y+8) == 0 || get_pixel(X , Y+8) == colorEscalo) &&
|
||||
(get_pixel(X+1, Y+8) == 0 || get_pixel(X+1, Y+8) == colorEscalo) &&
|
||||
(get_pixel(X+2, Y+8) == 0 || get_pixel(X+2, Y+8) == colorEscalo) &&
|
||||
(get_pixel(X , Y+9) == 0 || get_pixel(X , Y+9) == colorEscalo) &&
|
||||
(get_pixel(X+1, Y+9) == 0 || get_pixel(X+1, Y+9) == colorEscalo) &&
|
||||
(get_pixel(X+2, Y+9) == 0 || get_pixel(X+2, Y+9) == colorEscalo)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
bool ArounderProcesor::blockNovaCorda() {
|
||||
if (O == ORIENT_DRETA) {
|
||||
return (get_pixel(X+6, Y+8+altura) == 0 &&
|
||||
get_pixel(X+6, Y+9+altura) == 0 &&
|
||||
get_pixel(X+6, Y+10+altura) == 0
|
||||
);
|
||||
} else {
|
||||
return (get_pixel(X+1, Y+8+altura) == 0 &&
|
||||
get_pixel(X+1, Y+9+altura) == 0 &&
|
||||
get_pixel(X+1, Y+10+altura) == 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
bool ArounderProcesor::blockCordaBaixar(int desfase) {
|
||||
if (O == ORIENT_DRETA) {
|
||||
return (get_pixel(X+6-desfase, Y+8) == colorCorda);
|
||||
} else {
|
||||
return (get_pixel(X+1+desfase, Y+8) == colorCorda);
|
||||
}
|
||||
}
|
||||
|
||||
bool ArounderProcesor::blockCordaPujar(int desfase) {
|
||||
if (O == ORIENT_DRETA) {
|
||||
return (get_pixel(X+6-desfase, Y+5) == colorCorda);
|
||||
} else {
|
||||
return (get_pixel(X+1+desfase, Y+5) == colorCorda);
|
||||
}
|
||||
}
|
||||
|
||||
bool ArounderProcesor::checkArounderAnt(int x, int y, int o) {
|
||||
if ( accio == ACCIO_PARAR && (y >= Y-8) && (y <= Y+8) && ( (o == ORIENT_DRETA && X == x+8) || (o == ORIENT_ESQUERRA && X == x-8) ) ) {
|
||||
return true;
|
||||
} else {
|
||||
if (anterior != NULL) {
|
||||
return anterior->checkArounderAnt(x, y, o);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ArounderProcesor::checkArounderSig(int x, int y, int o) {
|
||||
if ( accio == ACCIO_PARAR && (y >= Y-8) && (y <= Y+8) && ( (o == ORIENT_DRETA && X == x+8) || (o == ORIENT_ESQUERRA && X == x-8) ) ) {
|
||||
return true;
|
||||
} else {
|
||||
if (siguiente != NULL) {
|
||||
return siguiente->checkArounderSig(x, y, o);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::doCavar() {
|
||||
if (O == ORIENT_DRETA) {
|
||||
put_pixel(X+8, Y, 0);
|
||||
put_pixel(X+8, Y+1, 0);
|
||||
put_pixel(X+8, Y+2, 0);
|
||||
put_pixel(X+8, Y+3, 0);
|
||||
put_pixel(X+8, Y+4, 0);
|
||||
put_pixel(X+8, Y+5, 0);
|
||||
put_pixel(X+8, Y+6, 0);
|
||||
put_pixel(X+8, Y+7, 0);
|
||||
} else {
|
||||
put_pixel(X-1, Y, 0);
|
||||
put_pixel(X-1, Y+1, 0);
|
||||
put_pixel(X-1, Y+2, 0);
|
||||
put_pixel(X-1, Y+3, 0);
|
||||
put_pixel(X-1, Y+4, 0);
|
||||
put_pixel(X-1, Y+5, 0);
|
||||
put_pixel(X-1, Y+6, 0);
|
||||
put_pixel(X-1, Y+7, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::doPerforar() {
|
||||
put_pixel(X , Y+8, 0);
|
||||
put_pixel(X+1, Y+8, 0);
|
||||
put_pixel(X+2, Y+8, 0);
|
||||
put_pixel(X+3, Y+8, 0);
|
||||
put_pixel(X+4, Y+8, 0);
|
||||
put_pixel(X+5, Y+8, 0);
|
||||
put_pixel(X+6, Y+8, 0);
|
||||
put_pixel(X+7, Y+8, 0);
|
||||
}
|
||||
|
||||
void ArounderProcesor::doEscalera(int desfase) {
|
||||
if (O == ORIENT_DRETA) {
|
||||
put_pixel(X+5, Y+7+desfase, colorEscalo);
|
||||
put_pixel(X+6, Y+7+desfase, colorEscalo);
|
||||
put_pixel(X+7, Y+7+desfase, colorEscalo);
|
||||
} else {
|
||||
put_pixel(X+2, Y+7+desfase, colorEscalo);
|
||||
put_pixel(X+1, Y+7+desfase, colorEscalo);
|
||||
put_pixel(X , Y+7+desfase, colorEscalo);
|
||||
}
|
||||
}
|
||||
|
||||
void ArounderProcesor::doCorda() {
|
||||
if (O == ORIENT_DRETA) {
|
||||
put_pixel(X+6, Y+8+altura, colorCorda);
|
||||
} else {
|
||||
put_pixel(X+1, Y+8+altura, colorCorda);
|
||||
}
|
||||
}
|
||||
|
||||
Uint32 ArounderProcesor::get_pixel( int x, int y )
|
||||
{
|
||||
return pixels[ ( y * mapa->w ) + x ];
|
||||
}
|
||||
|
||||
void ArounderProcesor::put_pixel( int x, int y, Uint32 pixel )
|
||||
{
|
||||
pixels[ ( y * mapa->w ) + x ] = pixel;
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
#pragma once
|
||||
#include "DrawManager.h"
|
||||
#include "MarcadorProcesor.h"
|
||||
#include "const.h"
|
||||
|
||||
const int ORIENT_DRETA = 0;
|
||||
const int ORIENT_ESQUERRA = 8;
|
||||
|
||||
class ArounderProcesor
|
||||
{
|
||||
public:
|
||||
ArounderProcesor(DrawManager *pDrawManager, MarcadorProcesor *pMarcadorProcesor, SDL_Surface *pSprites, SDL_Surface *pMapa, int pxInicial, int pyInicial, int pxFinal, int pyFinal );
|
||||
~ArounderProcesor(void);
|
||||
ArounderProcesor *Afegir();
|
||||
|
||||
void Pintar();
|
||||
void Procesar();
|
||||
ArounderProcesor *Seleccionar(int mouseX, int mouseY);
|
||||
void AbortarAccio();
|
||||
|
||||
ArounderProcesor *anterior;
|
||||
ArounderProcesor *siguiente;
|
||||
|
||||
int prevista;
|
||||
int accio;
|
||||
int X;
|
||||
int Y;
|
||||
int O;
|
||||
|
||||
Uint32 colorEscalo;
|
||||
Uint32 colorCorda;
|
||||
|
||||
private:
|
||||
SDL_Rect clip;
|
||||
SDL_Surface *sprites;
|
||||
SDL_Surface *mapa;
|
||||
SDL_Surface *explosio;
|
||||
Uint32 *pixels;
|
||||
|
||||
int frame;
|
||||
int frameX;
|
||||
int frameY;
|
||||
int altura;
|
||||
|
||||
int xInicial;
|
||||
int yInicial;
|
||||
int xFinal;
|
||||
int yFinal;
|
||||
|
||||
DrawManager *drawManager;
|
||||
MarcadorProcesor *marcadorProcesor;
|
||||
|
||||
void initMort();
|
||||
void initArrivat();
|
||||
void initCaminar();
|
||||
void initCaure();
|
||||
void initParar();
|
||||
void initCavar();
|
||||
void initEscalar();
|
||||
void initPerforar();
|
||||
void initEscalera();
|
||||
void initPasarela();
|
||||
void initCorda();
|
||||
void initPujarCorda();
|
||||
void initBaixarCorda();
|
||||
void initSuicidi();
|
||||
|
||||
void Matar();
|
||||
|
||||
void procesarCaminar();
|
||||
void procesarCaure();
|
||||
void procesarParar();
|
||||
void procesarCavar();
|
||||
void procesarEscalar();
|
||||
void procesarPerforar();
|
||||
void procesarEscalera();
|
||||
void procesarPasarela();
|
||||
void procesarCorda();
|
||||
void procesarPujarCorda();
|
||||
void procesarBaixarCorda();
|
||||
void procesarSuicidi();
|
||||
|
||||
bool blockCaure(int desfase = 0);
|
||||
bool blockCaminar();
|
||||
bool blockArounder();
|
||||
bool blockParet(int desfase = 0);
|
||||
bool blockTecho(int desfase = 0);
|
||||
bool blockPrecipici();
|
||||
bool blockPrecipiciPasarela();
|
||||
bool blockNovaCorda();
|
||||
bool blockCordaBaixar(int desfase = 0);
|
||||
bool blockCordaPujar(int desfase = 0);
|
||||
bool pujarEscalo();
|
||||
bool baixarEscalo();
|
||||
|
||||
bool checkArounderAnt(int x, int y, int o);
|
||||
bool checkArounderSig(int x, int y, int o);
|
||||
|
||||
void doCavar();
|
||||
void doPerforar();
|
||||
void doEscalera(int desfase = 0);
|
||||
void doCorda();
|
||||
|
||||
Uint32 get_pixel( int x, int y );
|
||||
void put_pixel( int x, int y, Uint32 pixel );
|
||||
};
|
||||
309
DrawManager.cpp
@@ -1,309 +0,0 @@
|
||||
#include "DrawManager.h"
|
||||
#include "const.h"
|
||||
#include "fileManager.h"
|
||||
#include "SDL/SDL_image.h"
|
||||
|
||||
|
||||
|
||||
DrawManager::DrawManager(int pMode)
|
||||
{
|
||||
mode = pMode;
|
||||
screen = NULL;
|
||||
screenBig = NULL;
|
||||
}
|
||||
|
||||
DrawManager::~DrawManager(void)
|
||||
{
|
||||
SDL_FreeSurface(temp);
|
||||
SDL_FreeSurface(black);
|
||||
SDL_FreeSurface(faded);
|
||||
}
|
||||
|
||||
bool DrawManager::Init(void)
|
||||
{
|
||||
switch (mode) {
|
||||
case 1:
|
||||
screenBig = SDL_SetVideoMode( SCREEN_WIDTH<<1, SCREEN_HEIGHT<<1, SCREEN_BPP, SDL_SWSURFACE );
|
||||
if( screenBig == NULL ) { return false; }
|
||||
screen = LoadBitmap("black.gif");
|
||||
break;
|
||||
case 2:
|
||||
screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_FULLSCREEN );
|
||||
if( screen == NULL ) { return false; }
|
||||
break;
|
||||
default:
|
||||
screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE );
|
||||
if( screen == NULL ) { return false; }
|
||||
break;
|
||||
}
|
||||
color_blanco = -1;
|
||||
color_rojo = SDL_MapRGB( screen->format, 255, 0, 0 );
|
||||
color_verde = SDL_MapRGB( screen->format, 0, 255, 0 );
|
||||
color_azul = SDL_MapRGB( screen->format, 0, 0, 255 );
|
||||
|
||||
black = LoadBitmap("black.gif");
|
||||
temp = LoadBitmap("black.gif");
|
||||
faded = LoadBitmap("black.gif");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DrawManager::Flip(void)
|
||||
{
|
||||
if (mode == 1) {
|
||||
for (int x=0; x<320; x++) {
|
||||
for (int y=0; y<200; y++) {
|
||||
put_pixel32(screenBig, x<<1 , y<<1 , get_pixel32(screen, x, y));
|
||||
put_pixel32(screenBig, (x<<1)+1, y<<1 , get_pixel32(screen, x, y));
|
||||
put_pixel32(screenBig, x<<1 , (y<<1)+1, get_pixel32(screen, x, y));
|
||||
put_pixel32(screenBig, (x<<1)+1, (y<<1)+1, get_pixel32(screen, x, y));
|
||||
}
|
||||
}
|
||||
if (SDL_Flip( screenBig ) == -1 ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (SDL_Flip( screen ) == -1 ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Surface *DrawManager::LoadBitmap(char *bitmapfilename, bool doColorKey)
|
||||
{
|
||||
//Get the bitmap's buffer and size from the resource file
|
||||
int filesize = 0;
|
||||
char *buffer = GetBufferFromResource(bitmapfilename, &filesize);
|
||||
|
||||
//Load the buffer into a surface using RWops
|
||||
SDL_RWops *rw = SDL_RWFromMem(buffer, filesize);
|
||||
//SDL_Surface *temp = SDL_LoadBMP_RW(rw, 1);
|
||||
SDL_Surface *temp = IMG_Load_RW(rw, 1);
|
||||
|
||||
//Release the bitmap buffer memory
|
||||
free(buffer);
|
||||
|
||||
//Were we able to load the bitmap?
|
||||
if (temp == NULL)
|
||||
{
|
||||
printf("Unable to load bitmap: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
//Convert the image to optimal display format
|
||||
SDL_Surface *image;
|
||||
image = SDL_DisplayFormat(temp);
|
||||
|
||||
if (doColorKey) {
|
||||
Uint32 colorkey = SDL_MapRGB( image->format, 0, 0, 0 );
|
||||
SDL_SetColorKey( image, SDL_SRCCOLORKEY, colorkey );
|
||||
}
|
||||
|
||||
//Free the temporary surface
|
||||
SDL_FreeSurface(temp);
|
||||
|
||||
//Return our loaded image
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
SDL_Surface *DrawManager::LoadMask(char *bitmapfilename)
|
||||
{
|
||||
//Get the bitmap's buffer and size from the resource file
|
||||
int filesize = 0;
|
||||
char *buffer = GetBufferFromResource(bitmapfilename, &filesize);
|
||||
|
||||
//Load the buffer into a surface using RWops
|
||||
SDL_RWops *rw = SDL_RWFromMem(buffer, filesize);
|
||||
//SDL_Surface *temp = SDL_LoadBMP_RW(rw, 1);
|
||||
SDL_Surface *temp = IMG_Load_RW(rw, 1);
|
||||
|
||||
//Release the bitmap buffer memory
|
||||
free(buffer);
|
||||
|
||||
//Were we able to load the bitmap?
|
||||
if (temp == NULL)
|
||||
{
|
||||
printf("Unable to load bitmap: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
//Convert the image to optimal display format
|
||||
SDL_Surface *image;
|
||||
image = SDL_DisplayFormat(temp);
|
||||
|
||||
Uint32 colorkey = SDL_MapRGB( image->format, 255, 255, 255 );
|
||||
SDL_SetColorKey( image, SDL_SRCCOLORKEY, colorkey );
|
||||
|
||||
//Free the temporary surface
|
||||
SDL_FreeSurface(temp);
|
||||
|
||||
//Return our loaded image
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
void DrawManager::apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip )
|
||||
{
|
||||
SDL_Rect offset;
|
||||
|
||||
offset.x = x;
|
||||
offset.y = y;
|
||||
|
||||
SDL_BlitSurface( source, clip, destination, &offset );
|
||||
}
|
||||
|
||||
void DrawManager::Blit( int x, int y, SDL_Surface* source, SDL_Rect* clip )
|
||||
{
|
||||
apply_surface(x, y, source, screen, clip);
|
||||
}
|
||||
|
||||
void DrawManager::Print( int x, int y, SDL_Surface* source, int w, int h, char *text, SDL_Surface *dest ) {
|
||||
int index = 0;
|
||||
SDL_Rect clip;
|
||||
|
||||
clip.y = 0;
|
||||
clip.w = w;
|
||||
clip.h = h;
|
||||
|
||||
if (dest == NULL) dest = screen;
|
||||
|
||||
while (text[index] > 0) {
|
||||
clip.x = (text[index] - 32) * 7;
|
||||
apply_surface(x+(index*w), y, source, dest, &clip);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawManager::FadeOut()
|
||||
{
|
||||
alpha = 0;
|
||||
apply_surface(0, 0, screen, temp);
|
||||
|
||||
int currentTicks;
|
||||
int startTicks = SDL_GetTicks();
|
||||
|
||||
while (alpha < 255) {
|
||||
SDL_SetAlpha( black, SDL_SRCALPHA | SDL_RLEACCEL, alpha );
|
||||
Blit(0,0, temp);
|
||||
Blit(0,0, black);
|
||||
Flip();
|
||||
|
||||
currentTicks = SDL_GetTicks() - startTicks;
|
||||
if( currentTicks >= 10 ) {
|
||||
startTicks = SDL_GetTicks();
|
||||
alpha+=8;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void DrawManager::FadeIn()
|
||||
{
|
||||
alpha = 255;
|
||||
apply_surface(0, 0, screen, temp);
|
||||
|
||||
int currentTicks;
|
||||
int startTicks = SDL_GetTicks();
|
||||
|
||||
while (alpha > 0) {
|
||||
SDL_SetAlpha( black, SDL_SRCALPHA | SDL_RLEACCEL, alpha );
|
||||
Blit(0,0, temp);
|
||||
Blit(0,0, black);
|
||||
Flip();
|
||||
|
||||
currentTicks = SDL_GetTicks() - startTicks;
|
||||
if( currentTicks >= 10 ) {
|
||||
startTicks = SDL_GetTicks();
|
||||
alpha-=8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawManager::FadeOutGray()
|
||||
{
|
||||
alpha = 0;
|
||||
apply_surface(0, 0, screen, temp);
|
||||
|
||||
int currentTicks;
|
||||
int startTicks = SDL_GetTicks();
|
||||
|
||||
while (alpha < 127) {
|
||||
SDL_SetAlpha( black, SDL_SRCALPHA | SDL_RLEACCEL, alpha );
|
||||
Blit(0,0, temp);
|
||||
Blit(0,0, black);
|
||||
Flip();
|
||||
|
||||
currentTicks = SDL_GetTicks() - startTicks;
|
||||
if( currentTicks >= 10 ) {
|
||||
startTicks = SDL_GetTicks();
|
||||
alpha+=8;
|
||||
}
|
||||
}
|
||||
apply_surface(0, 0, screen, faded);
|
||||
}
|
||||
|
||||
void DrawManager::FadeInGray()
|
||||
{
|
||||
alpha = 127;
|
||||
//apply_surface(0, 0, screen, temp);
|
||||
|
||||
int currentTicks;
|
||||
int startTicks = SDL_GetTicks();
|
||||
|
||||
while (alpha > 0) {
|
||||
SDL_SetAlpha( black, SDL_SRCALPHA | SDL_RLEACCEL, alpha );
|
||||
Blit(0,0, temp);
|
||||
Blit(0,0, black);
|
||||
Flip();
|
||||
|
||||
currentTicks = SDL_GetTicks() - startTicks;
|
||||
if( currentTicks >= 10 ) {
|
||||
startTicks = SDL_GetTicks();
|
||||
alpha-=8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawManager::DrawFadedBack() {
|
||||
Blit(0,0, faded);
|
||||
}
|
||||
|
||||
SDL_Surface *DrawManager::LoadFont(char *bitmapfilename, Uint32 color)
|
||||
{
|
||||
if (color == 0xFFFFFFFF) {
|
||||
return LoadBitmap(bitmapfilename, true);
|
||||
} else {
|
||||
SDL_Surface *temporal = LoadBitmap(bitmapfilename, true);
|
||||
if( SDL_MUSTLOCK( temporal ) ) { SDL_LockSurface( temporal ); }
|
||||
|
||||
for (int x=0; x<temporal->w; x++) {
|
||||
for (int y=0; y<temporal->h; y++) {
|
||||
if (get_pixel32(temporal, x, y) == 0xFFFFFF) {
|
||||
put_pixel32(temporal, x, y, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( SDL_MUSTLOCK( temporal ) ) { SDL_UnlockSurface( temporal ); }
|
||||
|
||||
return temporal;
|
||||
}
|
||||
}
|
||||
|
||||
Uint32 DrawManager::get_pixel32( SDL_Surface *surface, int x, int y )
|
||||
{
|
||||
Uint32 *pixels = (Uint32 *)surface->pixels;
|
||||
return pixels[ ( y * surface->w ) + x ];
|
||||
}
|
||||
|
||||
void DrawManager::put_pixel32( SDL_Surface *surface, int x, int y, Uint32 pixel )
|
||||
{
|
||||
Uint32 *pixels = (Uint32 *)surface->pixels;
|
||||
pixels[ ( y * surface->w ) + x ] = pixel;
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
#pragma once
|
||||
#include "SDL/SDL.h"
|
||||
|
||||
class DrawManager
|
||||
{
|
||||
public:
|
||||
DrawManager(int pMode);
|
||||
~DrawManager(void);
|
||||
|
||||
bool Init(void);
|
||||
bool Flip(void);
|
||||
|
||||
SDL_Surface *LoadBitmap(char *bitmapfilename, bool doColorKey = false);
|
||||
SDL_Surface *LoadMask(char *bitmapfilename);
|
||||
void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL );
|
||||
void Blit( int x, int y, SDL_Surface* source, SDL_Rect* clip = NULL );
|
||||
void Print( int x, int y, SDL_Surface* source, int w, int h, char *text, SDL_Surface* dest = NULL );
|
||||
void FadeOut();
|
||||
void FadeIn();
|
||||
void FadeOutGray();
|
||||
void FadeInGray();
|
||||
void DrawFadedBack();
|
||||
SDL_Surface *LoadFont(char *bitmapfilename, Uint32 color = 0xFFFFFFFF);
|
||||
|
||||
int mode;
|
||||
|
||||
Uint32 color_blanco;
|
||||
Uint32 color_rojo;
|
||||
Uint32 color_verde;
|
||||
Uint32 color_azul;
|
||||
private:
|
||||
SDL_Surface *screen;
|
||||
SDL_Surface *screenBig;
|
||||
SDL_Surface *black;
|
||||
SDL_Surface *temp;
|
||||
SDL_Surface *faded;
|
||||
int alpha;
|
||||
|
||||
Uint32 get_pixel32( SDL_Surface *surface, int x, int y );
|
||||
void put_pixel32( SDL_Surface *surface, int x, int y, Uint32 pixel );
|
||||
|
||||
};
|
||||
@@ -1,422 +0,0 @@
|
||||
#include "GameController.h"
|
||||
#include "const.h"
|
||||
#include "fileManager.h"
|
||||
|
||||
GameController::GameController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager) {
|
||||
drawManager = p_drawManager;
|
||||
inputManager = p_inputManager;
|
||||
musicManager = p_musicManager;
|
||||
}
|
||||
|
||||
GameController::~GameController(void) {
|
||||
}
|
||||
|
||||
bool GameController::Init()
|
||||
{
|
||||
char arxiuFondo[10] = "BKG00.GIF";
|
||||
arxiuFondo[4] = (gameInfo->fase % 10) + 48;
|
||||
fondo = drawManager->LoadBitmap(arxiuFondo);
|
||||
sprites = drawManager->LoadBitmap("sprites.gif", true);
|
||||
font1 = drawManager->LoadFont("fuente1.gif");
|
||||
cursor = drawManager->LoadFont("cursor.gif");
|
||||
puerta = drawManager->LoadFont("puerta.gif");
|
||||
marca = drawManager->LoadFont("marca.gif");
|
||||
menu = drawManager->LoadFont("menu.gif");
|
||||
|
||||
aiguaProcesor = new AiguaProcesor(drawManager, gameInfo->fase);
|
||||
marcadorProcesor = new MarcadorProcesor(drawManager);
|
||||
|
||||
CarregarMapa(gameInfo->fase);
|
||||
|
||||
primerArounder = new ArounderProcesor(drawManager, marcadorProcesor, sprites, mapa, (xInicial*16)+8, (yInicial*16)+8, (xFinal*16)+8, (yFinal*16)+8);
|
||||
marcadorProcesor->numAroundersEixits ++;
|
||||
arounderSeleccionat = primerArounder;
|
||||
|
||||
if ( ((gameInfo->fase+1) % 5) == 0) {
|
||||
musicManager->Load( "mus6.mp3");
|
||||
} else {
|
||||
musicManager->Load( "mus4.mp3");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void GameController::Go(GameInfo *pGameInfo)
|
||||
{
|
||||
gameInfo = pGameInfo;
|
||||
|
||||
bool salir = false;
|
||||
|
||||
int mouseX = 0;
|
||||
int mouseY = 0;
|
||||
int nuevaAccion = -1;
|
||||
|
||||
if ( !Init() ) { salir = true; gameInfo->estado = ESTADO_SALIR; }
|
||||
|
||||
musicManager->Play(-1);
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Blit(0,0, mapa);
|
||||
drawManager->FadeIn();
|
||||
|
||||
int arounderCount = SDL_GetTicks();
|
||||
startTicks = SDL_GetTicks();
|
||||
|
||||
while ( !salir ) {
|
||||
|
||||
PintarEscena();
|
||||
PintarCursor();
|
||||
drawManager->Flip();
|
||||
|
||||
inputManager->Update();
|
||||
mouseX = inputManager->mouseX;
|
||||
mouseY = inputManager->mouseY;
|
||||
|
||||
if (inputManager->Pausa() || inputManager->BotoPulsat(SDL_BUTTON_MIDDLE) || !inputManager->finestraActiva) {
|
||||
arounderCount = SDL_GetTicks() - arounderCount;
|
||||
salir = Pausa();
|
||||
arounderCount = SDL_GetTicks() - arounderCount;
|
||||
}
|
||||
|
||||
if (inputManager->Menu()) {
|
||||
arounderCount = SDL_GetTicks() - arounderCount;
|
||||
salir = Menu();
|
||||
arounderCount = SDL_GetTicks() - arounderCount;
|
||||
}
|
||||
|
||||
if (inputManager->eixir) {
|
||||
salir = true;
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
}
|
||||
|
||||
if (inputManager->BotoPulsat(SDL_BUTTON_RIGHT) && arounderSeleccionat != NULL) {
|
||||
arounderSeleccionat->AbortarAccio();
|
||||
}
|
||||
|
||||
if (inputManager->BotoPulsat(SDL_BUTTON_LEFT)) {
|
||||
ArounderProcesor *nouSeleccionat = primerArounder->Seleccionar(mouseX, mouseY);
|
||||
if (nouSeleccionat != NULL) {
|
||||
arounderSeleccionat = nouSeleccionat;
|
||||
} else if (mouseY < 165 && arounderSeleccionat != NULL && arounderSeleccionat->accio == ACCIO_CAMINAR) {
|
||||
if (mouseX > arounderSeleccionat->X) {
|
||||
arounderSeleccionat->O = ORIENT_DRETA;
|
||||
} else {
|
||||
arounderSeleccionat->O = ORIENT_ESQUERRA;
|
||||
}
|
||||
}
|
||||
nuevaAccion = marcadorProcesor->Procesar(mouseX, mouseY);
|
||||
}
|
||||
|
||||
if (inputManager->BotoSoltat(SDL_BUTTON_LEFT)) {
|
||||
if (nuevaAccion != -1 && arounderSeleccionat != NULL) {
|
||||
if (nuevaAccion == arounderSeleccionat->prevista) {
|
||||
arounderSeleccionat->prevista = arounderSeleccionat->accio;
|
||||
} else {
|
||||
arounderSeleccionat->prevista = nuevaAccion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
currentTicks = SDL_GetTicks() - startTicks;
|
||||
if( currentTicks >= marcadorProcesor->velocitat ) {
|
||||
startTicks = SDL_GetTicks();
|
||||
aiguaProcesor->Procesar();
|
||||
if (primerArounder != NULL) {
|
||||
primerArounder->Procesar();
|
||||
|
||||
ArounderProcesor *actual = primerArounder;
|
||||
while (actual->siguiente != NULL) {
|
||||
actual = actual->siguiente;
|
||||
}
|
||||
|
||||
while (actual != NULL) {
|
||||
if (actual->accio == ACCIO_MORT) {
|
||||
ArounderProcesor *borrar = actual;
|
||||
if (borrar->siguiente != NULL) {
|
||||
borrar->siguiente->anterior = borrar->anterior;
|
||||
}
|
||||
if (borrar->anterior != NULL) {
|
||||
borrar->anterior->siguiente = borrar->siguiente;
|
||||
}
|
||||
if (borrar == primerArounder) primerArounder = borrar->siguiente;
|
||||
if (borrar == arounderSeleccionat) arounderSeleccionat = NULL;
|
||||
actual = borrar->anterior;
|
||||
delete borrar;
|
||||
} else {
|
||||
actual = actual->anterior;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( (SDL_GetTicks() - arounderCount) >= marcadorProcesor->velocitat*58) {
|
||||
if (marcadorProcesor->numAroundersEixits < marcadorProcesor->numArounders) {
|
||||
if (primerArounder != NULL) {
|
||||
primerArounder->Afegir();
|
||||
} else {
|
||||
primerArounder = new ArounderProcesor(drawManager, marcadorProcesor, sprites, mapa, (xInicial*16)+8, (yInicial*16)+8, (xFinal*16)+8, (yFinal*16)+8);
|
||||
}
|
||||
marcadorProcesor->numAroundersEixits ++;
|
||||
arounderCount = SDL_GetTicks();
|
||||
}
|
||||
}
|
||||
|
||||
if (marcadorProcesor->numAroundersArrivats + marcadorProcesor->numAroundersMorts == marcadorProcesor->numArounders) {
|
||||
if (marcadorProcesor->numAroundersArrivats >= marcadorProcesor->AroundersNec) {
|
||||
salir = true;
|
||||
gameInfo->estado = ESTADO_POSTFASE;
|
||||
gameInfo->fase++;
|
||||
} else {
|
||||
salir = true;
|
||||
gameInfo->estado = ESTADO_MORT;
|
||||
}
|
||||
}
|
||||
|
||||
if (inputManager->BotoPulsat(SDL_BUTTON_MIDDLE)) {
|
||||
salir = true;
|
||||
gameInfo->estado = ESTADO_JUEGO;
|
||||
gameInfo->fase++;
|
||||
}
|
||||
/*if (arounderSeleccionat != NULL && arounderSeleccionat->prevista == ACCIO_SUICIDI2) {
|
||||
gameInfo->estado = ESTADO_MORT;
|
||||
salir = true;
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
musicManager->FadeOut();
|
||||
drawManager->FadeOut();
|
||||
|
||||
Finalize();
|
||||
}
|
||||
|
||||
void GameController::PintarEscena() {
|
||||
int accio = -1;
|
||||
int prevista = -1;
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Blit(0,0, mapa);
|
||||
drawManager->Blit(xInicial*16, yInicial*16, puerta);
|
||||
drawManager->Blit(xFinal*16, yFinal*16, puerta);
|
||||
|
||||
if (primerArounder != NULL) primerArounder->Pintar();
|
||||
|
||||
aiguaProcesor->Pintar();
|
||||
|
||||
if (arounderSeleccionat != NULL) {
|
||||
accio = arounderSeleccionat->accio;
|
||||
prevista = arounderSeleccionat->prevista;
|
||||
} else {
|
||||
accio = -1;
|
||||
prevista = -1;
|
||||
}
|
||||
marcadorProcesor->Pintar(font1, accio, prevista);
|
||||
|
||||
if (arounderSeleccionat != NULL) {
|
||||
drawManager->Blit(arounderSeleccionat->X-3, arounderSeleccionat->Y-3, marca);
|
||||
}
|
||||
}
|
||||
|
||||
void GameController::PintarCursor() {
|
||||
drawManager->Blit(inputManager->mouseX, inputManager->mouseY, cursor);
|
||||
}
|
||||
|
||||
bool GameController::Pausa() {
|
||||
|
||||
PintarEscena();
|
||||
drawManager->FadeOutGray();
|
||||
|
||||
bool salir = false;
|
||||
bool salirJuego = false;
|
||||
|
||||
while (!salir) {
|
||||
drawManager->DrawFadedBack();
|
||||
drawManager->Print(136,80, font1, 7, 5, "PAUSA");
|
||||
drawManager->Blit(inputManager->mouseX, inputManager->mouseY, cursor);
|
||||
drawManager->Flip();
|
||||
|
||||
inputManager->Update();
|
||||
if (inputManager->eixir) {
|
||||
salir = true;
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
}
|
||||
|
||||
if (inputManager->Menu()) {
|
||||
salirJuego = Menu(true);
|
||||
salir = salirJuego;
|
||||
}
|
||||
|
||||
if (inputManager->Pausa() || inputManager->BotoPulsat(SDL_BUTTON_MIDDLE)) salir = true;
|
||||
}
|
||||
|
||||
drawManager->FadeInGray();
|
||||
|
||||
return salirJuego;
|
||||
}
|
||||
|
||||
bool GameController::Menu(bool bypass) {
|
||||
|
||||
if (!bypass) {
|
||||
PintarEscena();
|
||||
drawManager->FadeOutGray();
|
||||
}
|
||||
|
||||
bool salir = false;
|
||||
bool salirJuego = false;
|
||||
|
||||
while (!salir) {
|
||||
drawManager->DrawFadedBack();
|
||||
drawManager->Blit(97, 52, menu);
|
||||
drawManager->Print(129,60, font1, 7, 5, "CONTINUAR");
|
||||
drawManager->Print(129,71, font1, 7, 5, "REINICIAR");
|
||||
drawManager->Print(112,82, font1, 7, 5, "MENU PRINCIPAL");
|
||||
drawManager->Print(143,93, font1, 7, 5, "EIXIR");
|
||||
drawManager->Blit(inputManager->mouseX, inputManager->mouseY, cursor);
|
||||
drawManager->Flip();
|
||||
|
||||
inputManager->Update();
|
||||
if (inputManager->eixir) {
|
||||
salir = true;
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
}
|
||||
if (inputManager->Menu()) salir = true;
|
||||
|
||||
if (inputManager->BotoPulsat(SDL_BUTTON_LEFT)) {
|
||||
if (inputManager->mouseX >= 97 && inputManager->mouseX <= 223) {
|
||||
if (inputManager->mouseY >= 60 && inputManager->mouseY <= 65) {
|
||||
salir = true;
|
||||
//salirJuego = true;
|
||||
//gameInfo->fase++;
|
||||
}
|
||||
if (inputManager->mouseY >= 71 && inputManager->mouseY <= 76) {
|
||||
salirJuego = true;
|
||||
salir = true;
|
||||
}
|
||||
if (inputManager->mouseY >= 82 && inputManager->mouseY <= 87) {
|
||||
salirJuego = true;
|
||||
salir = true;
|
||||
gameInfo->estado = ESTADO_MENU;
|
||||
}
|
||||
if (inputManager->mouseY >= 93 && inputManager->mouseY <= 98) {
|
||||
salirJuego = true;
|
||||
salir = true;
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bypass) {
|
||||
drawManager->FadeInGray();
|
||||
}
|
||||
|
||||
return salirJuego;
|
||||
}
|
||||
|
||||
void GameController::CarregarMapa(int numMapa)
|
||||
{
|
||||
int filesize = 0;
|
||||
char *buffer = GetBufferFromResource("MAPES.BAL", &filesize);
|
||||
|
||||
int punter = numMapa * 212;
|
||||
|
||||
int tileSet = buffer[punter++];
|
||||
punter++;
|
||||
marcadorProcesor->orientacioInicial = buffer[punter++];
|
||||
marcadorProcesor->numArounders = buffer[punter++];
|
||||
marcadorProcesor->AroundersNec = buffer[punter++];
|
||||
|
||||
marcadorProcesor->numParar = buffer[punter++];
|
||||
marcadorProcesor->numCavar = buffer[punter++];
|
||||
marcadorProcesor->numEscalar = buffer[punter++];
|
||||
marcadorProcesor->numPerforar = buffer[punter++];
|
||||
marcadorProcesor->numEscalera = buffer[punter++];
|
||||
marcadorProcesor->numPasarela = buffer[punter++];
|
||||
marcadorProcesor->numCorda = buffer[punter++];
|
||||
|
||||
SDL_Surface *tiles = drawManager->LoadBitmap("tiles.gif", true);
|
||||
mapa = drawManager->LoadBitmap("black.gif", true);
|
||||
|
||||
unsigned char tileActual;
|
||||
SDL_Rect clip;
|
||||
clip.w = 16;
|
||||
clip.h = 16;
|
||||
|
||||
for (int x=0; x<20; x++) {
|
||||
for (int y=0; y<10; y++) {
|
||||
tileActual = buffer[punter++];
|
||||
switch (tileActual) {
|
||||
case 255:
|
||||
break;
|
||||
case 254:
|
||||
xFinal = x;
|
||||
yFinal = y;
|
||||
break;
|
||||
case 253:
|
||||
xInicial = x;
|
||||
yInicial = y;
|
||||
break;
|
||||
default:
|
||||
clip.x = tileActual*16;
|
||||
clip.y = tileSet*16;
|
||||
drawManager->apply_surface(x*16, y*16, tiles, mapa, &clip);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL_FreeSurface(tiles);
|
||||
SDL_Surface *marcador = drawManager->LoadBitmap("marcador.gif", false);
|
||||
drawManager->apply_surface(0, 165, marcador, mapa);
|
||||
SDL_FreeSurface(marcador);
|
||||
|
||||
drawManager->Print(188,188, font1, 7, 5, formatejar(gameInfo->fase+1), mapa);
|
||||
|
||||
drawManager->Print(7,188, font1, 7, 5, "XX", mapa);
|
||||
drawManager->Print(135,188, font1, 7, 5, "XX", mapa);
|
||||
drawManager->Print(151,188, font1, 7, 5, "XX", mapa);
|
||||
|
||||
drawManager->Print(224,171, font1, 7, 5, "ACTIUS", mapa);
|
||||
drawManager->Print(224,177, font1, 7, 5, "TOTAL", mapa);
|
||||
drawManager->Print(224,183, font1, 7, 5, "NECESSARIS", mapa);
|
||||
drawManager->Print(224,189, font1, 7, 5, "ARRIVATS", mapa);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GameController::Finalize(void)
|
||||
{
|
||||
SDL_FreeSurface(font1);
|
||||
SDL_FreeSurface(mapa);
|
||||
SDL_FreeSurface(fondo);
|
||||
SDL_FreeSurface(marca);
|
||||
SDL_FreeSurface(sprites);
|
||||
SDL_FreeSurface(cursor);
|
||||
SDL_FreeSurface(puerta);
|
||||
SDL_FreeSurface(menu);
|
||||
delete aiguaProcesor;
|
||||
delete marcadorProcesor;
|
||||
|
||||
if (primerArounder != NULL) {
|
||||
while (primerArounder->siguiente != NULL) {
|
||||
delete primerArounder->siguiente;
|
||||
}
|
||||
delete primerArounder;
|
||||
}
|
||||
}
|
||||
|
||||
char *GameController::formatejar(int numero) {
|
||||
char *resultat;
|
||||
resultat = (char *) malloc(3);
|
||||
|
||||
if (numero > 9) {
|
||||
resultat[0] = (numero / 10) + 48;
|
||||
resultat[1] = (numero % 10) + 48;
|
||||
} else {
|
||||
resultat[0] = 48;
|
||||
resultat[1] = (numero % 10) + 48;
|
||||
}
|
||||
|
||||
resultat[2] = '\0';
|
||||
|
||||
return resultat;
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
#pragma once
|
||||
#include <list>
|
||||
#include "SDL/SDL.h"
|
||||
#include "GameInfo.h"
|
||||
#include "DrawManager.h"
|
||||
#include "InputManager.h"
|
||||
#include "MusicManager.h"
|
||||
#include "AiguaProcesor.h"
|
||||
#include "MarcadorProcesor.h"
|
||||
#include "ArounderProcesor.h"
|
||||
|
||||
class GameController
|
||||
{
|
||||
public:
|
||||
GameController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager);
|
||||
~GameController(void);
|
||||
|
||||
bool Init();
|
||||
void Go(GameInfo *pGameInfo);
|
||||
void Finalize(void);
|
||||
|
||||
private:
|
||||
DrawManager *drawManager;
|
||||
InputManager *inputManager;
|
||||
MusicManager *musicManager;
|
||||
AiguaProcesor *aiguaProcesor;
|
||||
MarcadorProcesor *marcadorProcesor;
|
||||
|
||||
ArounderProcesor *primerArounder;
|
||||
ArounderProcesor *arounderSeleccionat;
|
||||
|
||||
SDL_Surface *mapa;
|
||||
SDL_Surface *fondo;
|
||||
SDL_Surface *sprites;
|
||||
SDL_Surface *puerta;
|
||||
SDL_Surface *font1;
|
||||
SDL_Surface *cursor;
|
||||
SDL_Surface *marca;
|
||||
SDL_Surface *menu;
|
||||
|
||||
GameInfo *gameInfo;
|
||||
|
||||
int startTicks;
|
||||
int currentTicks;
|
||||
|
||||
int xInicial;
|
||||
int yInicial;
|
||||
int xFinal;
|
||||
int yFinal;
|
||||
|
||||
void PintarEscena();
|
||||
void PintarCursor();
|
||||
bool Pausa();
|
||||
bool Menu(bool bypass = false);
|
||||
void CarregarMapa(int numMapa);
|
||||
char *formatejar(int numero);
|
||||
|
||||
};
|
||||
11
GameInfo.cpp
@@ -1,11 +0,0 @@
|
||||
#include "GameInfo.h"
|
||||
#include "const.h"
|
||||
|
||||
GameInfo::GameInfo(int pModeGrafic) {
|
||||
fase = -1;
|
||||
estado = ESTADO_SEQUENCIA;
|
||||
modeGrafic = pModeGrafic;
|
||||
}
|
||||
|
||||
GameInfo::~GameInfo(void) {
|
||||
}
|
||||
14
GameInfo.h
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class GameInfo
|
||||
{
|
||||
public:
|
||||
GameInfo(int pModeGrafic);
|
||||
~GameInfo(void);
|
||||
|
||||
int fase;
|
||||
int puntuacion;
|
||||
int vidas;
|
||||
int estado;
|
||||
int modeGrafic;
|
||||
};
|
||||
44
Info.plist
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>19H2</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>arounders</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>arounders</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>arounders</string>
|
||||
<key>CFBundleIconName</key>
|
||||
<string>arounders</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>net.jailers.arounders</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>arounders</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.2.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.2.0</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.12</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright 2023 JailDoctor</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>SUPublicDSAKeyFile</key>
|
||||
<string>dsa_pub.pem</string>
|
||||
</dict>
|
||||
</plist>
|
||||
192
InputManager.cpp
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
* InputManager.cpp
|
||||
* Arounders
|
||||
*
|
||||
* Created by Raimon Zamora on 21/02/09.
|
||||
* Copyright 2009 __MyCompanyName__. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "InputManager.h"
|
||||
#include "const.h"
|
||||
|
||||
InputManager::InputManager(GameInfo *pGameInfo) {
|
||||
gameInfo = pGameInfo;
|
||||
|
||||
eixir = false;
|
||||
|
||||
mouseX = 0;
|
||||
mouseY = 0;
|
||||
|
||||
mouseButtonLeft = false;
|
||||
mouseButtonRight = false;
|
||||
mouseButtonMiddle = false;
|
||||
|
||||
oldMouseButtonLeft = false;
|
||||
oldMouseButtonRight = false;
|
||||
oldMouseButtonMiddle = false;
|
||||
|
||||
pausaPulsada = false;
|
||||
menuPulsat = false;
|
||||
|
||||
}
|
||||
|
||||
InputManager::~InputManager(void) {
|
||||
|
||||
}
|
||||
|
||||
void InputManager::Update() {
|
||||
keystates = SDL_GetKeyState( NULL );
|
||||
|
||||
teclaSoltada = false;
|
||||
pausaPulsada = false;
|
||||
menuPulsat = false;
|
||||
|
||||
while ( SDL_PollEvent( &event ) ) {
|
||||
if ( event.type == SDL_QUIT ) eixir = true;
|
||||
if( event.type == SDL_MOUSEMOTION ) {
|
||||
mouseX = event.motion.x;
|
||||
mouseY = event.motion.y;
|
||||
if (gameInfo->modeGrafic == MODE_ZOOMX2) {
|
||||
mouseX = mouseX>>1;
|
||||
mouseY = mouseY>>1;
|
||||
}
|
||||
}
|
||||
if( event.type == SDL_MOUSEBUTTONDOWN ) {
|
||||
mouseX = event.button.x;
|
||||
mouseY = event.button.y;
|
||||
if (gameInfo->modeGrafic == MODE_ZOOMX2) {
|
||||
mouseX = mouseX>>1;
|
||||
mouseY = mouseY>>1;
|
||||
}
|
||||
if (event.button.button == SDL_BUTTON_LEFT) {
|
||||
oldMouseButtonLeft = mouseButtonLeft;
|
||||
mouseButtonLeft = true;
|
||||
}
|
||||
if (event.button.button == SDL_BUTTON_MIDDLE) {
|
||||
oldMouseButtonMiddle = mouseButtonMiddle;
|
||||
mouseButtonMiddle = true;
|
||||
}
|
||||
if (event.button.button == SDL_BUTTON_RIGHT) {
|
||||
oldMouseButtonRight = mouseButtonRight;
|
||||
mouseButtonRight = true;
|
||||
}
|
||||
}
|
||||
if( event.type == SDL_MOUSEBUTTONUP ) {
|
||||
if (event.button.button == SDL_BUTTON_LEFT) {
|
||||
oldMouseButtonLeft = mouseButtonLeft;
|
||||
mouseButtonLeft = false;
|
||||
}
|
||||
if (event.button.button == SDL_BUTTON_MIDDLE) {
|
||||
oldMouseButtonMiddle = mouseButtonMiddle;
|
||||
mouseButtonMiddle = false;
|
||||
}
|
||||
if (event.button.button == SDL_BUTTON_RIGHT) {
|
||||
oldMouseButtonRight = mouseButtonRight;
|
||||
mouseButtonRight = false;
|
||||
}
|
||||
}
|
||||
if( event.type == SDL_KEYDOWN ) {
|
||||
cualquierTecla = true;
|
||||
} else {
|
||||
cualquierTecla = false;
|
||||
}
|
||||
|
||||
if( event.type == SDL_KEYUP ) {
|
||||
teclaSoltada = true;
|
||||
pausaPulsada = (event.key.keysym.sym == SDLK_p);
|
||||
menuPulsat = (event.key.keysym.sym == SDLK_ESCAPE);
|
||||
}
|
||||
|
||||
if ( event.type == SDL_ACTIVEEVENT ) {
|
||||
if (event.active.state & SDL_APPINPUTFOCUS) {
|
||||
if (event.active.gain) {
|
||||
finestraActiva = true;
|
||||
} else {
|
||||
finestraActiva = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool InputManager::BotoPulsat(int boto) {
|
||||
switch (boto) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
if (mouseButtonLeft && !oldMouseButtonLeft) {
|
||||
oldMouseButtonLeft = true;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SDL_BUTTON_MIDDLE:
|
||||
if (mouseButtonMiddle && !oldMouseButtonMiddle) {
|
||||
oldMouseButtonMiddle = true;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SDL_BUTTON_RIGHT:
|
||||
if (mouseButtonRight && !oldMouseButtonRight) {
|
||||
oldMouseButtonRight = true;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool InputManager::BotoSoltat(int boto) {
|
||||
switch (boto) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
if (!mouseButtonLeft && oldMouseButtonLeft) {
|
||||
oldMouseButtonLeft = false;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SDL_BUTTON_MIDDLE:
|
||||
if (!mouseButtonMiddle && oldMouseButtonMiddle) {
|
||||
oldMouseButtonMiddle = false;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SDL_BUTTON_RIGHT:
|
||||
if (!mouseButtonRight && oldMouseButtonRight) {
|
||||
oldMouseButtonRight = false;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool InputManager::TeclaPulsada(int tecla) {
|
||||
if (keystates[tecla] != 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool InputManager::Pausa() {
|
||||
return pausaPulsada;
|
||||
}
|
||||
|
||||
bool InputManager::Menu() {
|
||||
return menuPulsat;
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#pragma once
|
||||
#include "SDL/SDL.h"
|
||||
#include "GameInfo.h"
|
||||
|
||||
class InputManager
|
||||
{
|
||||
public:
|
||||
InputManager(GameInfo *pGameInfo);
|
||||
~InputManager(void);
|
||||
|
||||
void Update();
|
||||
bool Pausa();
|
||||
bool EixirPausa();
|
||||
bool Menu();
|
||||
bool BotoPulsat(int boto);
|
||||
bool BotoSoltat(int boto);
|
||||
|
||||
bool TeclaPulsada(int tecla);
|
||||
|
||||
bool cualquierTecla;
|
||||
bool teclaSoltada;
|
||||
bool eixir;
|
||||
int mouseX;
|
||||
int mouseY;
|
||||
bool mouseButtonLeft;
|
||||
bool mouseButtonRight;
|
||||
bool mouseButtonMiddle;
|
||||
bool pausaPulsada;
|
||||
bool menuPulsat;
|
||||
bool finestraActiva;
|
||||
|
||||
private:
|
||||
Uint8 *keystates;
|
||||
GameInfo *gameInfo;
|
||||
|
||||
SDL_Event event;
|
||||
bool oldMouseButtonLeft;
|
||||
bool oldMouseButtonRight;
|
||||
bool oldMouseButtonMiddle;
|
||||
|
||||
};
|
||||
140
Makefile
Normal file
@@ -0,0 +1,140 @@
|
||||
executable = arounders
|
||||
source = source/*.cpp
|
||||
appName = arounders
|
||||
releaseFolder = release
|
||||
version = v1.2.1
|
||||
|
||||
# Release names
|
||||
windowsRelease = $(executable)-$(version)-win32-x64.zip
|
||||
macosIntelRelease = $(executable)-$(version)-macos-intel.dmg
|
||||
macosAppleSiliconRelease = $(executable)-$(version)-macos-apple-silicon.dmg
|
||||
linuxRelease = $(executable)-$(version)-linux.tar.gz
|
||||
|
||||
windows:
|
||||
@echo off
|
||||
windres icon.rc -O coff icon.res
|
||||
g++ $(source) icon.res -D VERSION=\"$(version)\" -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lmingw32 -lSDL2main -lSDL2 -lSDL2_mixer -mwindows -o "$(executable).exe"
|
||||
strip -s -R .comment -R .gnu.version --strip-unneeded "$(executable).exe"
|
||||
|
||||
windows_debug:
|
||||
@echo off
|
||||
g++ $(source) -D DEBUG -D VERSION=\"$(version)\" -g -Wall -fvar-tracking -lmingw32 -lSDL2main -lSDL2 -lSDL2_mixer -o "$(executable)_debug.exe"
|
||||
|
||||
windows_release:
|
||||
@echo off
|
||||
|
||||
# Fem el paquetet
|
||||
respak2 -p
|
||||
|
||||
# Create release folder
|
||||
powershell if (Test-Path "$(releaseFolder)") {Remove-Item "$(releaseFolder)" -Recurse -Force}
|
||||
powershell if (-not (Test-Path "$(releaseFolder)")) {New-Item "$(releaseFolder)" -ItemType Directory}
|
||||
|
||||
# Copy root files
|
||||
powershell Copy-Item "data.jf2" -Destination "$(releaseFolder)"
|
||||
powershell Copy-Item "versions.txt" -Destination "$(releaseFolder)"
|
||||
powershell Copy-Item "README.md" -Destination "$(releaseFolder)"
|
||||
powershell Copy-Item "bin\*.dll" -Destination "$(releaseFolder)"
|
||||
|
||||
# Build
|
||||
windres icon.rc -O coff icon.res
|
||||
g++ $(source) icon.res -D VERSION=\"$(version)\" -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lmingw32 -lSDL2main -lSDL2 -lSDL2_mixer -mwindows -o "$(releaseFolder)/$(executable).exe"
|
||||
strip -s -R .comment -R .gnu.version --strip-unneeded "$(releaseFolder)/$(executable).exe"
|
||||
|
||||
# Create ZIP
|
||||
powershell if (Test-Path $(windowsRelease)) {Remove-Item $(windowsRelease)}
|
||||
powershell Compress-Archive -Path "$(releaseFolder)"/* -DestinationPath $(windowsRelease)
|
||||
|
||||
# Remove folder
|
||||
powershell if (Test-Path "$(releaseFolder)") {Remove-Item "$(releaseFolder)" -Recurse -Force}
|
||||
|
||||
macos:
|
||||
clang++ $(source) -D VERSION=\"$(version)\" -Wall -Os -std=c++11 -ffunction-sections -fdata-sections -lSDL2 -lSDL2_mixer -o "$(executable)"
|
||||
|
||||
macos_debug:
|
||||
clang++ $(source) -D DEBUG -D VERSION=\"$(version)\" -g -Wall -std=c++11 -lSDL2 -lSDL2_mixer -o "$(executable)_debug"
|
||||
|
||||
macos_release:
|
||||
# Remove data and possible data from previous builds
|
||||
rm -rdf "$(releaseFolder)"
|
||||
rm -rdf Frameworks
|
||||
rm -f tmp.dmg
|
||||
rm -f "$(macosIntelRelease)"
|
||||
rm -f "$(macosAppleSiliconRelease)"
|
||||
|
||||
# Create folders
|
||||
mkdir -p "$(releaseFolder)/$(appName).app/Contents/Frameworks"
|
||||
mkdir -p "$(releaseFolder)/$(appName).app/Contents/MacOS"
|
||||
mkdir -p "$(releaseFolder)/$(appName).app/Contents/Resources"
|
||||
mkdir -p Frameworks
|
||||
|
||||
# Fem el paquetet
|
||||
respak2 -p
|
||||
|
||||
# Copy folders
|
||||
cp data.jf2 "$(releaseFolder)/$(appName).app/Contents/Resources"
|
||||
cp -R bin/*.framework "$(releaseFolder)/$(appName).app/Contents/Frameworks"
|
||||
cp -R bin/*.framework Frameworks
|
||||
|
||||
# Copy files
|
||||
cp *.icns "$(releaseFolder)/$(appName).app/Contents/Resources"
|
||||
cp Info.plist "$(releaseFolder)/$(appName).app/Contents"
|
||||
cp versions.txt "$(releaseFolder)"
|
||||
cp README.md "$(releaseFolder)"
|
||||
|
||||
# Create links
|
||||
ln -s /Applications "$(releaseFolder)"/Applications
|
||||
|
||||
# Build INTEL
|
||||
clang++ $(source) -D MACOS_BUNDLE -D VERSION=\"$(version)\" -Wall -Os -std=c++11 -framework SDL2 -framework SDL2_mixer -F ./Frameworks -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.12
|
||||
|
||||
# Build INTEL DMG
|
||||
hdiutil create tmp.dmg -ov -volname "$(appName)" -fs HFS+ -srcfolder "$(releaseFolder)"
|
||||
hdiutil convert tmp.dmg -format UDZO -o "$(macosIntelRelease)"
|
||||
rm -f tmp.dmg
|
||||
|
||||
# Build APPLE SILICON
|
||||
clang++ $(source) -D MACOS_BUNDLE -D VERSION=\"$(version)\" -std=c++11 -Wall -Os -framework SDL2 -framework SDL2_mixer -F ./Frameworks -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
|
||||
|
||||
# Build APPLE SILICON DMG
|
||||
hdiutil create tmp.dmg -ov -volname "$(appName)" -fs HFS+ -srcfolder "$(releaseFolder)"
|
||||
hdiutil convert tmp.dmg -format UDZO -o "$(macosAppleSiliconRelease)"
|
||||
rm -f tmp.dmg
|
||||
|
||||
# Remove data
|
||||
rm -rdf Frameworks
|
||||
rm -rdf "$(releaseFolder)"
|
||||
|
||||
|
||||
linux:
|
||||
g++ $(source) -D VERSION=\"$(version)\" -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lSDL2 -lSDL2_mixer -o "$(executable)"
|
||||
strip -s -R .comment -R .gnu.version --strip-unneeded "$(executable)"
|
||||
|
||||
linux_debug:
|
||||
g++ $(source) -D DEBUG -D VERSION=\"$(version)\" -g -Wall -fvar-tracking -lSDL2 -lSDL2_mixer -o "$(executable)_debug"
|
||||
|
||||
linux_release:
|
||||
# Remove data
|
||||
rm -rdf "$(releaseFolder)"
|
||||
|
||||
# Create folders
|
||||
mkdir -p "$(releaseFolder)"
|
||||
|
||||
# Fem el paquetet
|
||||
respak2 -p
|
||||
|
||||
# Copy data
|
||||
cp data.jf2 "$(releaseFolder)"
|
||||
cp versions.txt "$(releaseFolder)"
|
||||
cp README.md "$(releaseFolder)"
|
||||
|
||||
# Build
|
||||
g++ $(source) -D VERSION=\"$(version)\" -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lSDL2 -lSDL2_mixer -o "$(releaseFolder)/$(executable)"
|
||||
strip -s -R .comment -R .gnu.version --strip-unneeded "$(releaseFolder)/$(executable)"
|
||||
|
||||
# Pack files
|
||||
rm -f "$(linuxRelease)"
|
||||
cd "$(releaseFolder)" && tar -czvf "../$(linuxRelease)" *
|
||||
|
||||
# Remove data
|
||||
rm -rdf "$(releaseFolder)"
|
||||
@@ -1,110 +0,0 @@
|
||||
#include "MarcadorProcesor.h"
|
||||
#include "const.h"
|
||||
|
||||
MarcadorProcesor::MarcadorProcesor(DrawManager *pDrawManager)
|
||||
{
|
||||
drawManager = pDrawManager;
|
||||
|
||||
numAroundersArrivats = 0;
|
||||
numAroundersEixits = 0;
|
||||
numAroundersMorts = 0;
|
||||
|
||||
boto = drawManager->LoadBitmap("boto.gif", true);
|
||||
|
||||
velocitat = 70;
|
||||
contador = SDL_GetTicks();
|
||||
}
|
||||
|
||||
MarcadorProcesor::~MarcadorProcesor(void)
|
||||
{
|
||||
SDL_FreeSurface(boto);
|
||||
}
|
||||
|
||||
void MarcadorProcesor::Pintar(SDL_Surface *font, int accio, int prevista) {
|
||||
drawManager->Print(23,188, font, 7, 5, formatejar(numParar));
|
||||
drawManager->Print(39,188, font, 7, 5, formatejar(numCavar));
|
||||
drawManager->Print(55,188, font, 7, 5, formatejar(numEscalar));
|
||||
drawManager->Print(71,188, font, 7, 5, formatejar(numPerforar));
|
||||
drawManager->Print(87,188, font, 7, 5, formatejar(numEscalera));
|
||||
drawManager->Print(103,188, font, 7, 5, formatejar(numPasarela));
|
||||
drawManager->Print(119,188, font, 7, 5, formatejar(numCorda));
|
||||
|
||||
drawManager->Print(301,171, font, 7, 5, formatejar(numAroundersEixits-numAroundersArrivats-numAroundersMorts));
|
||||
drawManager->Print(301,177, font, 7, 5, formatejar(numArounders));
|
||||
drawManager->Print(301,183, font, 7, 5, formatejar(AroundersNec));
|
||||
drawManager->Print(301,189, font, 7, 5, formatejar(numAroundersArrivats));
|
||||
|
||||
if (accio >= 10) accio = 0;
|
||||
if (prevista >= 10) prevista = 0;
|
||||
drawManager->Blit((accio*16)+5, 171, boto);
|
||||
|
||||
if (prevista != accio && prevista != 0) {
|
||||
if ((SDL_GetTicks()-contador) <= 200) {
|
||||
drawManager->Blit((prevista*16)+5, 171, boto);
|
||||
} else {
|
||||
if ((SDL_GetTicks()-contador) >= 400) contador = SDL_GetTicks();
|
||||
}
|
||||
}
|
||||
|
||||
if (velocitat < 70) {
|
||||
drawManager->Blit((ACCIO_SUICIDI2*16)+5, 171, boto);
|
||||
}
|
||||
}
|
||||
|
||||
int MarcadorProcesor::Procesar(int mouseX, int mouseY) {
|
||||
int accio = -1;
|
||||
|
||||
if (mouseY >= 171 && mouseY <= 187 && mouseX >= 5 && mouseX <= 165) {
|
||||
accio = (mouseX-5) / 16;
|
||||
|
||||
switch(accio) {
|
||||
case ACCIO_PARAR:
|
||||
if (numParar == 0) accio = -1;
|
||||
break;
|
||||
case ACCIO_CAVAR:
|
||||
if (numCavar == 0) accio = -1;
|
||||
break;
|
||||
case ACCIO_ESCALAR:
|
||||
if (numEscalar == 0) accio = -1;
|
||||
break;
|
||||
case ACCIO_PERFORAR:
|
||||
if (numPerforar == 0) accio = -1;
|
||||
break;
|
||||
case ACCIO_ESCALERA:
|
||||
if (numEscalera == 0) accio = -1;
|
||||
break;
|
||||
case ACCIO_PASARELA:
|
||||
if (numPasarela == 0) accio = -1;
|
||||
break;
|
||||
case ACCIO_CORDA:
|
||||
if (numCorda == 0) accio = -1;
|
||||
break;
|
||||
case ACCIO_SUICIDI2:
|
||||
if (velocitat == 70) {
|
||||
velocitat = 10;
|
||||
} else {
|
||||
velocitat = 70;
|
||||
}
|
||||
accio = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return accio;
|
||||
}
|
||||
|
||||
char *MarcadorProcesor::formatejar(int numero) {
|
||||
char *resultat;
|
||||
resultat = (char *) malloc(3);
|
||||
|
||||
if (numero > 9) {
|
||||
resultat[0] = (numero / 10) + 48;
|
||||
resultat[1] = (numero % 10) + 48;
|
||||
} else {
|
||||
resultat[0] = 48;
|
||||
resultat[1] = (numero % 10) + 48;
|
||||
}
|
||||
|
||||
resultat[2] = '\0';
|
||||
|
||||
return resultat;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
#pragma once
|
||||
#include "DrawManager.h"
|
||||
|
||||
class MarcadorProcesor
|
||||
{
|
||||
public:
|
||||
MarcadorProcesor(DrawManager *pDrawManager);
|
||||
~MarcadorProcesor(void);
|
||||
|
||||
void Pintar(SDL_Surface *font, int accio, int prevista);
|
||||
int Procesar(int mouseX, int mouseY);
|
||||
|
||||
int numArounders;
|
||||
int AroundersNec;
|
||||
int numAroundersArrivats;
|
||||
int numAroundersEixits;
|
||||
int numAroundersMorts;
|
||||
int orientacioInicial;
|
||||
|
||||
int numParar;
|
||||
int numCavar;
|
||||
int numEscalar;
|
||||
int numPerforar;
|
||||
int numEscalera;
|
||||
int numPasarela;
|
||||
int numCorda;
|
||||
|
||||
int velocitat;
|
||||
|
||||
private:
|
||||
char *formatejar(int numero);
|
||||
|
||||
DrawManager *drawManager;
|
||||
SDL_Surface *boto;
|
||||
|
||||
int contador;
|
||||
|
||||
};
|
||||
@@ -1,76 +0,0 @@
|
||||
#include "MenuController.h"
|
||||
#include "const.h"
|
||||
|
||||
MenuController::MenuController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager) {
|
||||
drawManager = p_drawManager;
|
||||
inputManager = p_inputManager;
|
||||
musicManager = p_musicManager;
|
||||
}
|
||||
|
||||
MenuController::~MenuController(void) {
|
||||
}
|
||||
|
||||
bool MenuController::Init() {
|
||||
fondo = drawManager->LoadBitmap("menuprin.gif");
|
||||
cursor = drawManager->LoadFont("cursor.gif");
|
||||
if (!musicManager->Sonant()) {
|
||||
musicManager->Load( "mus3.mp3");
|
||||
musicManager->Play(-1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void MenuController::Go(GameInfo *gameInfo) {
|
||||
bool salir = false;
|
||||
|
||||
if ( !Init() ) { salir = true; gameInfo->estado = ESTADO_SALIR; }
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->FadeIn();
|
||||
|
||||
while ( !salir ) {
|
||||
inputManager->Update();
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Blit(inputManager->mouseX, inputManager->mouseY, cursor);
|
||||
drawManager->Flip();
|
||||
|
||||
if (inputManager->eixir) {
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
salir = true;
|
||||
}
|
||||
|
||||
if (inputManager->BotoPulsat(SDL_BUTTON_LEFT)) {
|
||||
if (inputManager->mouseX >= 200 &&
|
||||
inputManager->mouseY >= 100 &&
|
||||
inputManager->mouseX <= 270 &&
|
||||
inputManager->mouseY <= 120 ) {
|
||||
gameInfo->estado = ESTADO_SEQUENCIA;
|
||||
gameInfo->fase = 0;
|
||||
salir = true;
|
||||
}
|
||||
if (inputManager->mouseX >= 175 &&
|
||||
inputManager->mouseY >= 125 &&
|
||||
inputManager->mouseX <= 290 &&
|
||||
inputManager->mouseY <= 145 ) {
|
||||
gameInfo->estado = ESTADO_PASSWORD;
|
||||
gameInfo->fase = 0;
|
||||
salir = true;
|
||||
}
|
||||
if (inputManager->mouseX >= 200 &&
|
||||
inputManager->mouseY >= 150 &&
|
||||
inputManager->mouseX <= 265 &&
|
||||
inputManager->mouseY <= 170 ) {
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
salir = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gameInfo->estado == ESTADO_SALIR) musicManager->FadeOut();
|
||||
drawManager->FadeOut();
|
||||
}
|
||||
|
||||
void MenuController::Finalize(void) {
|
||||
SDL_FreeSurface(fondo);
|
||||
SDL_FreeSurface(cursor);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#pragma once
|
||||
#include "SDL/SDL.h"
|
||||
#include "DrawManager.h"
|
||||
#include "InputManager.h"
|
||||
#include "MusicManager.h"
|
||||
#include "GameInfo.h"
|
||||
|
||||
class MenuController
|
||||
{
|
||||
public:
|
||||
MenuController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager);
|
||||
~MenuController(void);
|
||||
|
||||
bool Init();
|
||||
void Go(GameInfo *gameInfo);
|
||||
void Finalize(void);
|
||||
|
||||
private:
|
||||
DrawManager *drawManager;
|
||||
InputManager *inputManager;
|
||||
MusicManager *musicManager;
|
||||
|
||||
SDL_Surface *fondo;
|
||||
SDL_Surface *cursor;
|
||||
};
|
||||
@@ -1,72 +0,0 @@
|
||||
#include "MortController.h"
|
||||
#include "const.h"
|
||||
|
||||
MortController::MortController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager) {
|
||||
drawManager = p_drawManager;
|
||||
inputManager = p_inputManager;
|
||||
musicManager = p_musicManager;
|
||||
}
|
||||
|
||||
MortController::~MortController(void) {
|
||||
}
|
||||
|
||||
bool MortController::Init() {
|
||||
fondo = drawManager->LoadBitmap("mort.gif");
|
||||
cursor = drawManager->LoadFont("cursor.gif");
|
||||
musicManager->Load( "mus5.mp3");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MortController::Go(GameInfo *gameInfo) {
|
||||
bool salir = false;
|
||||
|
||||
if ( !Init() ) { salir = true; gameInfo->estado = ESTADO_SALIR; }
|
||||
|
||||
musicManager->Play(-1);
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->FadeIn();
|
||||
|
||||
while ( !salir ) {
|
||||
inputManager->Update();
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Blit(inputManager->mouseX, inputManager->mouseY, cursor);
|
||||
drawManager->Flip();
|
||||
|
||||
if (inputManager->eixir) {
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
salir = true;
|
||||
}
|
||||
|
||||
if (inputManager->BotoPulsat(SDL_BUTTON_LEFT)) {
|
||||
if (inputManager->mouseX >= 100 &&
|
||||
inputManager->mouseY >= 50 &&
|
||||
inputManager->mouseX <= 210 &&
|
||||
inputManager->mouseY <= 70 ) {
|
||||
gameInfo->estado = ESTADO_PREFASE;
|
||||
salir = true;
|
||||
}
|
||||
if (inputManager->mouseX >= 120 &&
|
||||
inputManager->mouseY >= 72 &&
|
||||
inputManager->mouseX <= 190 &&
|
||||
inputManager->mouseY <= 95 ) {
|
||||
gameInfo->estado = ESTADO_MENU;
|
||||
salir = true;
|
||||
}
|
||||
if (inputManager->mouseX >= 120 &&
|
||||
inputManager->mouseY >= 95 &&
|
||||
inputManager->mouseX <= 190 &&
|
||||
inputManager->mouseY <= 115 ) {
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
salir = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
drawManager->FadeOut();
|
||||
}
|
||||
|
||||
void MortController::Finalize(void) {
|
||||
SDL_FreeSurface(fondo);
|
||||
SDL_FreeSurface(cursor);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#pragma once
|
||||
#include "SDL/SDL.h"
|
||||
#include "DrawManager.h"
|
||||
#include "InputManager.h"
|
||||
#include "MusicManager.h"
|
||||
#include "GameInfo.h"
|
||||
|
||||
class MortController
|
||||
{
|
||||
public:
|
||||
MortController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager);
|
||||
~MortController(void);
|
||||
|
||||
bool Init();
|
||||
void Go(GameInfo *gameInfo);
|
||||
void Finalize(void);
|
||||
|
||||
private:
|
||||
DrawManager *drawManager;
|
||||
InputManager *inputManager;
|
||||
MusicManager *musicManager;
|
||||
|
||||
SDL_Surface *fondo;
|
||||
SDL_Surface *cursor;
|
||||
};
|
||||
@@ -1,52 +0,0 @@
|
||||
#include "MusicManager.h"
|
||||
#include "const.h"
|
||||
#include "fileManager.h"
|
||||
|
||||
MusicManager::MusicManager(void) {
|
||||
music = NULL;
|
||||
}
|
||||
|
||||
MusicManager::~MusicManager(void) {
|
||||
Mix_FreeMusic(music);
|
||||
Mix_CloseAudio();
|
||||
}
|
||||
|
||||
bool MusicManager::Init() {
|
||||
return Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024);
|
||||
}
|
||||
|
||||
void MusicManager::Load(char *musicfilename)
|
||||
{
|
||||
if (music != NULL) {
|
||||
Mix_HaltMusic();
|
||||
Mix_FreeMusic(music);
|
||||
}
|
||||
Mix_VolumeMusic(MIX_MAX_VOLUME);
|
||||
//Get the bitmap's buffer and size from the resource file
|
||||
int filesize = 0;
|
||||
char *buffer = GetBufferFromResource(musicfilename, &filesize);
|
||||
|
||||
//Load the buffer into a surface using RWops
|
||||
SDL_RWops *rw = SDL_RWFromMem(buffer, filesize);
|
||||
//SDL_Surface *temp = SDL_LoadBMP_RW(rw, 1);
|
||||
music = Mix_LoadMUS_RW(rw);
|
||||
|
||||
//Release the bitmap buffer memory
|
||||
//free(buffer);
|
||||
}
|
||||
|
||||
void MusicManager::Play(int loops) {
|
||||
Mix_PlayMusic(music, loops);
|
||||
}
|
||||
|
||||
void MusicManager::Pause() {
|
||||
Mix_PauseMusic();
|
||||
}
|
||||
|
||||
void MusicManager::FadeOut() {
|
||||
Mix_FadeOutMusic(500);
|
||||
}
|
||||
|
||||
bool MusicManager::Sonant() {
|
||||
return (Mix_PlayingMusic() == 1) && (Mix_FadingMusic() != MIX_FADING_OUT);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
#include "SDL/SDL_mixer.h"
|
||||
|
||||
class MusicManager
|
||||
{
|
||||
public:
|
||||
MusicManager(void);
|
||||
~MusicManager(void);
|
||||
|
||||
bool Init(void);
|
||||
void Load(char *musicfilename);
|
||||
void Play(int loops);
|
||||
void Pause();
|
||||
void FadeOut();
|
||||
bool Sonant();
|
||||
private:
|
||||
Mix_Music *music;
|
||||
};
|
||||
@@ -1,116 +0,0 @@
|
||||
#include "PasswordController.h"
|
||||
#include "const.h"
|
||||
#include "fileManager.h"
|
||||
|
||||
PasswordController::PasswordController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager) {
|
||||
drawManager = p_drawManager;
|
||||
inputManager = p_inputManager;
|
||||
musicManager = p_musicManager;
|
||||
}
|
||||
|
||||
PasswordController::~PasswordController(void) {
|
||||
}
|
||||
|
||||
bool PasswordController::Init() {
|
||||
fondo = drawManager->LoadBitmap("prefase.gif");
|
||||
cursor = drawManager->LoadFont("cursor.gif");
|
||||
font = drawManager->LoadFont("fuente1.gif");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void PasswordController::Go(GameInfo *gameInfo) {
|
||||
bool salir = false;
|
||||
char tecla = -1;
|
||||
char password[11] = " ";
|
||||
char indice = 0;
|
||||
|
||||
if ( !Init() ) { salir = true; gameInfo->estado = ESTADO_SALIR; }
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Print(95, 80, font, 7, 5, "ESCRIU EL PASSWORD");
|
||||
drawManager->FadeIn();
|
||||
|
||||
while ( !salir ) {
|
||||
inputManager->Update();
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Print(95, 80, font, 7, 5, "ESCRIU EL PASSWORD");
|
||||
drawManager->Print(123, 140, font, 7, 5, password);
|
||||
drawManager->Flip();
|
||||
|
||||
if (inputManager->eixir) {
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
salir = true;
|
||||
}
|
||||
|
||||
if (inputManager->cualquierTecla && tecla == -1) {
|
||||
if (inputManager->TeclaPulsada(SDLK_BACKSPACE) && indice > 0) {
|
||||
indice--;
|
||||
password[indice] = 32;
|
||||
tecla = SDLK_BACKSPACE;
|
||||
} else {
|
||||
tecla = ObtenerTecla();
|
||||
if (tecla != -1) {
|
||||
password[indice] = tecla;
|
||||
indice++;
|
||||
if (indice == 10) {
|
||||
gameInfo->fase = ObtenerFaseDePassword(password);
|
||||
gameInfo->estado = ESTADO_SEQUENCIA;
|
||||
salir = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (inputManager->teclaSoltada) {
|
||||
tecla = -1;
|
||||
}
|
||||
}
|
||||
drawManager->FadeOut();
|
||||
}
|
||||
|
||||
char PasswordController::ObtenerTecla() {
|
||||
char tecla = -1;
|
||||
for (int i=48; i<=57; i++) {
|
||||
if (inputManager->TeclaPulsada(i)) tecla = i;
|
||||
}
|
||||
for (int i=97; i<=122; i++) {
|
||||
if (inputManager->TeclaPulsada(i)) tecla = i-32;
|
||||
}
|
||||
return tecla;
|
||||
}
|
||||
|
||||
int PasswordController::ObtenerFaseDePassword(char *password) {
|
||||
int filesize = 0;
|
||||
char *buffer = GetBufferFromResource("offsets.bal", &filesize);
|
||||
|
||||
int punter = 0;
|
||||
|
||||
bool salir = false;
|
||||
char passFile[11] = " ";
|
||||
int numPassword = 0;
|
||||
|
||||
while ( numPassword < 30 && !salir ) {
|
||||
for (int i=0;i<10;i++) {
|
||||
punter++;
|
||||
passFile[i] = buffer[punter] - (101+i);
|
||||
}
|
||||
punter++;
|
||||
|
||||
salir = true;
|
||||
for (int i=0;i<10;i++) {
|
||||
if (passFile[i] != password[i]) salir = false;
|
||||
}
|
||||
numPassword++;
|
||||
}
|
||||
|
||||
if (!salir) numPassword = 0;
|
||||
|
||||
return numPassword;
|
||||
}
|
||||
|
||||
void PasswordController::Finalize(void) {
|
||||
SDL_FreeSurface(fondo);
|
||||
SDL_FreeSurface(cursor);
|
||||
SDL_FreeSurface(font);
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
#pragma once
|
||||
#include "SDL/SDL.h"
|
||||
#include "DrawManager.h"
|
||||
#include "InputManager.h"
|
||||
#include "MusicManager.h"
|
||||
#include "GameInfo.h"
|
||||
|
||||
class PasswordController
|
||||
{
|
||||
public:
|
||||
PasswordController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager);
|
||||
~PasswordController(void);
|
||||
|
||||
bool Init();
|
||||
void Go(GameInfo *gameInfo);
|
||||
void Finalize(void);
|
||||
|
||||
private:
|
||||
char ObtenerTecla();
|
||||
int ObtenerFaseDePassword(char *password);
|
||||
|
||||
DrawManager *drawManager;
|
||||
InputManager *inputManager;
|
||||
MusicManager *musicManager;
|
||||
|
||||
SDL_Surface *fondo;
|
||||
SDL_Surface *cursor;
|
||||
SDL_Surface *font;
|
||||
|
||||
};
|
||||
@@ -1,137 +0,0 @@
|
||||
#include "PostfaseController.h"
|
||||
#include "const.h"
|
||||
#include "fileManager.h"
|
||||
|
||||
PostfaseController::PostfaseController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager) {
|
||||
drawManager = p_drawManager;
|
||||
inputManager = p_inputManager;
|
||||
musicManager = p_musicManager;
|
||||
}
|
||||
|
||||
PostfaseController::~PostfaseController(void) {
|
||||
}
|
||||
|
||||
bool PostfaseController::Init() {
|
||||
fondo = drawManager->LoadBitmap("postfase.gif");
|
||||
font = drawManager->LoadFont("fuente2.gif", drawManager->color_rojo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void PostfaseController::Go(GameInfo *gameInfo) {
|
||||
bool salir = false;
|
||||
|
||||
if (gameInfo->fase == 30) {
|
||||
gameInfo->estado = ESTADO_SEQUENCIA;
|
||||
return;
|
||||
} else {
|
||||
musicManager->Load( "mus3.mp3");
|
||||
musicManager->Play(-1);
|
||||
}
|
||||
|
||||
if (gameInfo->fase % 5 == 0 && gameInfo->fase != 30) {
|
||||
salir = MostrarVictoria(gameInfo);
|
||||
}
|
||||
|
||||
if (salir) {
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
return;
|
||||
}
|
||||
|
||||
char *password = ObtenerPasswordDeFase(gameInfo->fase);
|
||||
if ( !Init() ) { salir = true; gameInfo->estado = ESTADO_SALIR; }
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Print(175, 166, font, 7, 6, password);
|
||||
drawManager->FadeIn();
|
||||
|
||||
while ( !salir ) {
|
||||
inputManager->Update();
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Print(175, 166, font, 7, 6, password);
|
||||
drawManager->Flip();
|
||||
|
||||
if (inputManager->eixir) {
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
salir = true;
|
||||
}
|
||||
|
||||
if (inputManager->cualquierTecla || inputManager->BotoPulsat(SDL_BUTTON_LEFT)) {
|
||||
gameInfo->estado = ESTADO_SEQUENCIA;
|
||||
salir = true;
|
||||
}
|
||||
}
|
||||
drawManager->FadeOut();
|
||||
}
|
||||
|
||||
char *PostfaseController::ObtenerPasswordDeFase(int fase) {
|
||||
int filesize = 0;
|
||||
char *buffer = GetBufferFromResource("offsets.bal", &filesize);
|
||||
|
||||
int punter = (fase-1)*11;
|
||||
|
||||
char *passFile = (char *) malloc(11);
|
||||
|
||||
for (int i=0;i<10;i++) {
|
||||
punter++;
|
||||
passFile[i] = ((Uint8)buffer[punter]) - (101+i);
|
||||
}
|
||||
|
||||
return passFile;
|
||||
}
|
||||
|
||||
bool PostfaseController::MostrarVictoria(GameInfo *gameInfo) {
|
||||
bool salir = false;
|
||||
|
||||
switch (gameInfo->fase) {
|
||||
case 5:
|
||||
fondo = drawManager->LoadBitmap("final01.GIF");
|
||||
break;
|
||||
case 10:
|
||||
fondo = drawManager->LoadBitmap("final02.GIF");
|
||||
break;
|
||||
case 15:
|
||||
fondo = drawManager->LoadBitmap("final03.GIF");
|
||||
break;
|
||||
case 20:
|
||||
fondo = drawManager->LoadBitmap("final04.GIF");
|
||||
break;
|
||||
case 25:
|
||||
fondo = drawManager->LoadBitmap("final05.GIF");
|
||||
break;
|
||||
}
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->FadeIn();
|
||||
|
||||
while ( !salir ) {
|
||||
inputManager->Update();
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Flip();
|
||||
|
||||
if (inputManager->eixir) {
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
salir = true;
|
||||
}
|
||||
|
||||
if (inputManager->cualquierTecla || inputManager->BotoPulsat(SDL_BUTTON_LEFT)) {
|
||||
gameInfo->estado = ESTADO_SEQUENCIA;
|
||||
salir = true;
|
||||
}
|
||||
}
|
||||
drawManager->FadeOut();
|
||||
|
||||
if (gameInfo->estado == ESTADO_SALIR) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void PostfaseController::Finalize(void) {
|
||||
SDL_FreeSurface(fondo);
|
||||
SDL_FreeSurface(font);
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#pragma once
|
||||
#include "SDL/SDL.h"
|
||||
#include "DrawManager.h"
|
||||
#include "InputManager.h"
|
||||
#include "MusicManager.h"
|
||||
#include "GameInfo.h"
|
||||
|
||||
class PostfaseController
|
||||
{
|
||||
public:
|
||||
PostfaseController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager);
|
||||
~PostfaseController(void);
|
||||
|
||||
bool Init();
|
||||
void Go(GameInfo *gameInfo);
|
||||
void Finalize(void);
|
||||
|
||||
private:
|
||||
char *ObtenerPasswordDeFase(int fase);
|
||||
bool MostrarVictoria(GameInfo *gameInfo);
|
||||
|
||||
DrawManager *drawManager;
|
||||
InputManager *inputManager;
|
||||
MusicManager *musicManager;
|
||||
|
||||
SDL_Surface *fondo;
|
||||
SDL_Surface *font;
|
||||
};
|
||||
@@ -1,105 +0,0 @@
|
||||
#include "PrefaseController.h"
|
||||
#include "const.h"
|
||||
#include "fileManager.h"
|
||||
|
||||
PrefaseController::PrefaseController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager) {
|
||||
drawManager = p_drawManager;
|
||||
inputManager = p_inputManager;
|
||||
musicManager = p_musicManager;
|
||||
}
|
||||
|
||||
PrefaseController::~PrefaseController(void) {
|
||||
}
|
||||
|
||||
bool PrefaseController::Init() {
|
||||
fondo = drawManager->LoadBitmap("prefase.gif");
|
||||
cursor = drawManager->LoadFont("cursor.gif");
|
||||
font = drawManager->LoadFont("fuente1.gif");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void PrefaseController::Go(GameInfo *gameInfo) {
|
||||
bool salir = false;
|
||||
|
||||
if ( !Init() ) { salir = true; gameInfo->estado = ESTADO_SALIR; }
|
||||
|
||||
CarregarMapa(gameInfo->fase);
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Print(130, 60, font, 7, 5, "NIVELL");
|
||||
drawManager->Print(179, 60, font, 7, 5, formatejar(gameInfo->fase+1));
|
||||
|
||||
drawManager->Print(80, 100, font, 7, 5, formatejar(numArounders));
|
||||
drawManager->Print(101, 100, font, 7, 5, "AROUNDERS DISPONIBLES");
|
||||
|
||||
drawManager->Print(80, 110, font, 7, 5, formatejar(aroundersNec));
|
||||
drawManager->Print(101, 110, font, 7, 5, "AROUNDERS NECESSARIS");
|
||||
drawManager->FadeIn();
|
||||
|
||||
while ( !salir ) {
|
||||
inputManager->Update();
|
||||
|
||||
drawManager->Blit(0,0, fondo);
|
||||
|
||||
drawManager->Print(130, 60, font, 7, 5, "NIVELL");
|
||||
drawManager->Print(179, 60, font, 7, 5, formatejar(gameInfo->fase+1));
|
||||
|
||||
drawManager->Print(80, 100, font, 7, 5, formatejar(numArounders));
|
||||
drawManager->Print(101, 100, font, 7, 5, "AROUNDERS DISPONIBLES");
|
||||
|
||||
drawManager->Print(80, 110, font, 7, 5, formatejar(aroundersNec));
|
||||
drawManager->Print(101, 110, font, 7, 5, "AROUNDERS NECESSARIS");
|
||||
|
||||
drawManager->Blit(inputManager->mouseX, inputManager->mouseY, cursor);
|
||||
drawManager->Flip();
|
||||
|
||||
if (inputManager->eixir) {
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
salir = true;
|
||||
}
|
||||
|
||||
if (inputManager->cualquierTecla || inputManager->BotoPulsat(SDL_BUTTON_LEFT)) {
|
||||
gameInfo->estado = ESTADO_JUEGO;
|
||||
salir = true;
|
||||
}
|
||||
}
|
||||
musicManager->FadeOut();
|
||||
drawManager->FadeOut();
|
||||
}
|
||||
|
||||
void PrefaseController::Finalize(void) {
|
||||
SDL_FreeSurface(fondo);
|
||||
SDL_FreeSurface(cursor);
|
||||
SDL_FreeSurface(font);
|
||||
}
|
||||
|
||||
void PrefaseController::CarregarMapa(int numMapa)
|
||||
{
|
||||
int filesize = 0;
|
||||
char *buffer = GetBufferFromResource("MAPES.BAL", &filesize);
|
||||
|
||||
int punter = numMapa * 212;
|
||||
|
||||
int tileSet = buffer[punter++];
|
||||
punter += 2;
|
||||
numArounders = buffer[punter++];
|
||||
aroundersNec = buffer[punter++];
|
||||
}
|
||||
|
||||
char *PrefaseController::formatejar(int numero) {
|
||||
char *resultat;
|
||||
resultat = (char *) malloc(3);
|
||||
|
||||
if (numero > 9) {
|
||||
resultat[0] = (numero / 10) + 48;
|
||||
resultat[1] = (numero % 10) + 48;
|
||||
} else {
|
||||
resultat[0] = 48;
|
||||
resultat[1] = (numero % 10) + 48;
|
||||
}
|
||||
|
||||
resultat[2] = '\0';
|
||||
|
||||
return resultat;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
#pragma once
|
||||
#include "SDL/SDL.h"
|
||||
#include "DrawManager.h"
|
||||
#include "InputManager.h"
|
||||
#include "MusicManager.h"
|
||||
#include "GameInfo.h"
|
||||
|
||||
class PrefaseController
|
||||
{
|
||||
public:
|
||||
PrefaseController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager);
|
||||
~PrefaseController(void);
|
||||
|
||||
bool Init();
|
||||
void Go(GameInfo *gameInfo);
|
||||
void Finalize(void);
|
||||
|
||||
private:
|
||||
char *formatejar(int numero);
|
||||
void CarregarMapa(int numMapa);
|
||||
|
||||
DrawManager *drawManager;
|
||||
InputManager *inputManager;
|
||||
MusicManager *musicManager;
|
||||
|
||||
SDL_Surface *fondo;
|
||||
SDL_Surface *cursor;
|
||||
SDL_Surface *font;
|
||||
|
||||
int numArounders;
|
||||
int aroundersNec;
|
||||
};
|
||||
128
README.md
Normal file
@@ -0,0 +1,128 @@
|
||||
# AROUNDERS
|
||||
versió 1.2
|
||||
|
||||

|
||||
|
||||
## HISTÒRIA
|
||||
|
||||
Al principi dels temps l'univers era una massa concetrada de materia que va explotar i...
|
||||
però avancem un poc en la història: Açò era baloo, barba peluda, el pelo pinxo i pantaló
|
||||
bermuda, que se anava a menjar narantxes, se ana a dentr para hechar desmadre, però antes
|
||||
se ana a fer-se un cortaet... i aixó pot ser FATAL...
|
||||
|
||||
|
||||
## REQUERIMENTS TÈCNICS
|
||||
|
||||
[NOTA de 2023: Hui en dia açò va en qualsevol cosa que tinga CPU]
|
||||
|
||||
Aquest joc s'ha testejat en un Core2Duo 2.66GHz i 2Mb de RAM sense cap mena de problemes
|
||||
Teòricament, deuria funcionar amb comps molt més xungos, pero no tinc temps ara de provar-ho.
|
||||
|
||||
- Targeta de só.
|
||||
- Targeta de video.
|
||||
- Ratolí.
|
||||
- Teclat.
|
||||
- Disc Dur.
|
||||
- Monitor.
|
||||
- Impresora (¿¿??)
|
||||
OPCIONAL: Scanner, scanner!
|
||||
|
||||

|
||||
|
||||
## INSTRUCCIONS
|
||||
|
||||
Has de dur a tots els arounders necessaris des d'una porta del nivell fins l'altra.
|
||||
|
||||
**Teclat**:
|
||||
- **ESC**: Mostra el menú intern del joc, desde el qual pots:
|
||||
- **CONTINUAR**: Continues jugant per on anaves
|
||||
- **REINICIAR**: Reinicia el nivell actual
|
||||
- **TORNAR AL MENU**: Pos aixó
|
||||
- **EIXIR**: Eix del programa
|
||||
- **P**: Pausa (tornar a apretar per a eixir de la Pausa)
|
||||
|
||||
**Ratolí**:
|
||||
- Botó Esquerre: Seleccionar arounder / seleccionar acció
|
||||
- Botó Dret: El arounder seleccionat deixa de fer el que està fent. Si te una acció en cua la executa.
|
||||
- Boto del mig: Pausa
|
||||
|
||||
**Accions**: (ordenades d'esquerra a dreta de la barra)
|
||||
|
||||
- **Aroundar**:
|
||||
Per defecte, no farà falta mai que apretem aquest botó. El arounder caminarà fins que
|
||||
no puga seguir (i pegarà la volta) o fins la mort...
|
||||
|
||||
- **Parar**:
|
||||
El arounder pararà de aroundar i, a més, farà pegar la volta a tots els arounders que
|
||||
se li acosten. Aquesta acció es du a terme nomes pulsar el botó.
|
||||
|
||||
- **Cavar**:
|
||||
El arounder farà un forat en la paret fins que no hi haja res més que foradar. Aquesta
|
||||
acció es du a terme quan el arounder es trobe amb una paret.
|
||||
|
||||
- **Escalar**:
|
||||
El arounder escalarà fins que arrive dalt del tot, o no puga seguir. Es dú a terme al
|
||||
trobar-se una paret.
|
||||
|
||||
- **Perforar**:
|
||||
Fà un forat en terra, fins que no puga seguir avall. Es dú a terme només pulsar el botó.
|
||||
|
||||
- **Escalera**:
|
||||
Construeix una escalera fins que no puga seguir o s'acaven els escalons. Es dú a terme
|
||||
nomes pulsar el botó.
|
||||
|
||||
- **Pasarela**:
|
||||
Com la escalera però en horitzontal. Construeix un pont. Es dú a terme al trobar un precipici.
|
||||
|
||||
- **Corda**:
|
||||
El arounder solta una corda desde un precipici fins a terra. Es dú a terme al trobar-se
|
||||
un precipici. Tots els arounders que arriven a un precipici amb corda, baixaran per ella,
|
||||
pero els que se troben baix pujaran per ella. Si pugen per el costat equivocat, cauran.
|
||||
|
||||
- **Suicidi**:
|
||||
El arounder agarra i explota de rabia. La mort es immediata.
|
||||
|
||||
- **Fast Forward**:
|
||||
No es una acció per al arounder seleccionat, sino que accelera la partida per a que els
|
||||
arounders vagen més apresa.
|
||||
|
||||
Si el arounder ja està fent una acció i es pulsa en altra, es mantindrà en la cua fins que s'acave l'acció actual o s'aborte.
|
||||
|
||||
Si es vol anul·lar una acció en cua, es pot tornar a pulsar el botó corresponent.
|
||||
|
||||
Crec que tot lo demés ja parla per si sol...
|
||||
|
||||
|
||||
## RECOMANACIONS
|
||||
|
||||
- El secret de la majoria dels nivells és començar bé. Deuràs tindre reflexos d'acer per a
|
||||
completar els nivells !!!
|
||||
|
||||
- Nomes començar el nivell, apreta la pausa i mira-ho tot bé. La pausa serà una gran
|
||||
aliada, ja que mentre estas en pausa pots moure el cursor.
|
||||
|
||||
- Els arounders no poden caure de molt alt, nomes soporten cuatre vegades la seua altura.
|
||||
Un pixel de més i tindras tortilla de arounder.
|
||||
|
||||
- Alguns nivells es poden solventar de diverses formes, si t'atranques, prova altra forma.
|
||||
Molts nivells son més facils del que pareix
|
||||
|
||||
- Però en altres nivells necessitaras apurar fins l'ultim pixel: Si no aconsegueixes
|
||||
passar-te'l, pot ser no apures el suficient.
|
||||
|
||||
- Recorda que totes les accions es poden parar quan a tu t'interese pulsant el botó dret.
|
||||
|
||||
## BUGS & POLLS
|
||||
|
||||
|
||||
Si trobes un polls, dis-me EXACTAMENT que has fet per a que passe. Si et dona
|
||||
algun missatge d'error, apuntalo EXACTAMENT com el fica. Gracies.
|
||||
|
||||
Pots comunicar els polls que trobes ací: https://gitea.sustancia.synology.me/JailDoctor/arounders/issues
|
||||
|
||||
- La acció corda és molt sensible. Si la utilitzes, i abans del precipici hi ha un desnivell
|
||||
d'uns pocs pixels, el arounder intentarà sense exit utilitzar la corda, perdent-la.
|
||||
|
||||
Dubtes, consultes, consells, polls, cheques al portador...
|
||||
|
||||
jaildoctor@gmail.com
|
||||
@@ -1,214 +0,0 @@
|
||||
#include "SequenceController.h"
|
||||
#include "const.h"
|
||||
#include "fileManager.h"
|
||||
|
||||
SequenceController::SequenceController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager) {
|
||||
drawManager = p_drawManager;
|
||||
inputManager = p_inputManager;
|
||||
musicManager = p_musicManager;
|
||||
}
|
||||
|
||||
SequenceController::~SequenceController(void) {
|
||||
}
|
||||
|
||||
bool SequenceController::Init() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void SequenceController::Go(GameInfo *pGameInfo) {
|
||||
bool salir = false;
|
||||
int pantalla = 0;
|
||||
char *file;
|
||||
int filesize;
|
||||
|
||||
gameInfo = pGameInfo;
|
||||
|
||||
if (gameInfo->fase % 5 == 0 || gameInfo->fase < 0) {
|
||||
switch (gameInfo->fase) {
|
||||
case -1:
|
||||
file = GetBufferFromResource("seqIN.seq", &filesize);
|
||||
break;
|
||||
case 0:
|
||||
file = GetBufferFromResource("seq00.seq", &filesize);
|
||||
break;
|
||||
case 5:
|
||||
file = GetBufferFromResource("seq05.seq", &filesize);
|
||||
break;
|
||||
case 10:
|
||||
file = GetBufferFromResource("seq10.seq", &filesize);
|
||||
break;
|
||||
case 15:
|
||||
file = GetBufferFromResource("seq15.seq", &filesize);
|
||||
break;
|
||||
case 20:
|
||||
file = GetBufferFromResource("seq20.seq", &filesize);
|
||||
break;
|
||||
case 25:
|
||||
file = GetBufferFromResource("seq25.seq", &filesize);
|
||||
break;
|
||||
case 30:
|
||||
file = GetBufferFromResource("seq30.seq", &filesize);
|
||||
break;
|
||||
}
|
||||
ProcesarSecuencia(file);
|
||||
}
|
||||
//drawManager->FadeOut();
|
||||
|
||||
if (gameInfo->estado != ESTADO_SALIR) {
|
||||
gameInfo->estado = ESTADO_PREFASE;
|
||||
if (gameInfo->fase == -1) gameInfo->estado = ESTADO_MENU;
|
||||
if (gameInfo->fase == 30) gameInfo->estado = ESTADO_MENU;
|
||||
}
|
||||
}
|
||||
|
||||
void SequenceController::ProcesarSecuencia(char *file) {
|
||||
char numDiapositives = (char)file[0];
|
||||
int punter = 1;
|
||||
char *filename;
|
||||
char *texto;
|
||||
char tamanyCadena;
|
||||
Uint16 x;
|
||||
Uint16 y;
|
||||
Uint16 temps;
|
||||
char colorTemp;
|
||||
Uint32 color;
|
||||
bool salir = false;
|
||||
|
||||
for (int j=0; j<numDiapositives; j++) {
|
||||
if (salir) {
|
||||
FadeOutWithMusic();
|
||||
break;
|
||||
}
|
||||
|
||||
char tipusDiapositiva = (char)file[punter++];
|
||||
x = 0;
|
||||
y = 0;
|
||||
temps = 0;
|
||||
switch (tipusDiapositiva) {
|
||||
case DIAPO_ESPERAR:
|
||||
temps = (Uint16)(((unsigned char)file[punter+1] << 8) + (unsigned char)file[punter]);
|
||||
salir = !Esperar(temps);
|
||||
punter += 2;
|
||||
break;
|
||||
case DIAPO_FADEIN:
|
||||
tamanyCadena = file[punter++];
|
||||
filename = (char *) malloc(tamanyCadena + 1);
|
||||
for (int i=0; i<tamanyCadena; i++) filename[i] = file[punter++];
|
||||
filename[tamanyCadena] = '\0';
|
||||
FadeIn(filename);
|
||||
break;
|
||||
case DIAPO_SHOW:
|
||||
tamanyCadena = file[punter++];
|
||||
filename = (char *) malloc(tamanyCadena + 1);
|
||||
for (int i=0; i<tamanyCadena; i++) filename[i] = file[punter++];
|
||||
filename[tamanyCadena] = '\0';
|
||||
Show(filename);
|
||||
break;
|
||||
case DIAPO_PRINT:
|
||||
x = (Uint16)(((unsigned char)file[punter+1] << 8) + (unsigned char)file[punter]);
|
||||
punter+=2;
|
||||
y = (Uint16)(((unsigned char)file[punter+1] << 8) + (unsigned char)file[punter]);
|
||||
punter+=2;
|
||||
colorTemp = file[punter++];
|
||||
switch (colorTemp) {
|
||||
case 0:
|
||||
color = drawManager->color_blanco;
|
||||
break;
|
||||
case 1:
|
||||
color = drawManager->color_rojo;
|
||||
break;
|
||||
case 2:
|
||||
color = drawManager->color_verde;
|
||||
break;
|
||||
case 3:
|
||||
color = drawManager->color_azul;
|
||||
break;
|
||||
}
|
||||
tamanyCadena = file[punter++];
|
||||
texto = (char *) malloc(tamanyCadena + 1);
|
||||
for (int i=0; i<tamanyCadena; i++) texto[i] = file[punter++];
|
||||
texto[tamanyCadena] = '\0';
|
||||
Print(x, y, color, texto);
|
||||
break;
|
||||
case DIAPO_MUSICA:
|
||||
tamanyCadena = file[punter++];
|
||||
filename = (char *) malloc(tamanyCadena + 1);
|
||||
for (int i=0; i<tamanyCadena; i++) filename[i] = file[punter++];
|
||||
filename[tamanyCadena] = '\0';
|
||||
Musica(filename, -1);
|
||||
break;
|
||||
case DIAPO_FADEOUT:
|
||||
FadeOut();
|
||||
break;
|
||||
case DIAPO_FADEMUSIC:
|
||||
FadeOutWithMusic();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool SequenceController::Esperar(Uint32 temps) {
|
||||
bool seguirIntro = true;
|
||||
bool salir = false;
|
||||
Uint32 startTicks = SDL_GetTicks();
|
||||
|
||||
while ( !salir ) {
|
||||
inputManager->Update();
|
||||
|
||||
if (inputManager->eixir) {
|
||||
gameInfo->estado = ESTADO_SALIR;
|
||||
salir = true;
|
||||
seguirIntro = false;
|
||||
}
|
||||
|
||||
if (inputManager->cualquierTecla || inputManager->BotoPulsat(SDL_BUTTON_LEFT)) {
|
||||
salir = true;
|
||||
if (inputManager->TeclaPulsada(SDLK_ESCAPE)) seguirIntro = false;
|
||||
}
|
||||
|
||||
if (SDL_GetTicks()-startTicks > temps) {
|
||||
salir = true;
|
||||
}
|
||||
}
|
||||
return seguirIntro;
|
||||
}
|
||||
|
||||
void SequenceController::FadeIn(char *archivo) {
|
||||
fondo = drawManager->LoadBitmap( archivo);
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->FadeIn();
|
||||
SDL_FreeSurface(fondo);
|
||||
}
|
||||
|
||||
void SequenceController::Show(char *archivo) {
|
||||
fondo = drawManager->LoadBitmap( archivo);
|
||||
drawManager->Blit(0,0, fondo);
|
||||
drawManager->Flip();
|
||||
SDL_FreeSurface(fondo);
|
||||
}
|
||||
|
||||
void SequenceController::Print(int x, int y, Uint32 color, char *texto) {
|
||||
font = drawManager->LoadFont( "fuente2.gif", color);
|
||||
drawManager->Print(x, y, font, 7, 6, texto);
|
||||
drawManager->Flip();
|
||||
SDL_FreeSurface(font);
|
||||
}
|
||||
|
||||
void SequenceController::FadeOut() {
|
||||
drawManager->FadeOut();
|
||||
}
|
||||
|
||||
void SequenceController::FadeOutWithMusic() {
|
||||
drawManager->FadeOut();
|
||||
musicManager->FadeOut();
|
||||
}
|
||||
|
||||
void SequenceController::Musica(char *archivo, int loop) {
|
||||
musicManager->Load(archivo);
|
||||
musicManager->Play(loop);
|
||||
}
|
||||
|
||||
void SequenceController::Finalize(void) {
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#pragma once
|
||||
#include "SDL/SDL.h"
|
||||
#include "DrawManager.h"
|
||||
#include "InputManager.h"
|
||||
#include "MusicManager.h"
|
||||
#include "GameInfo.h"
|
||||
|
||||
class SequenceController
|
||||
{
|
||||
public:
|
||||
SequenceController(DrawManager *p_drawManager, InputManager *p_inputManager, MusicManager *p_musicManager);
|
||||
~SequenceController(void);
|
||||
|
||||
bool Init();
|
||||
void Go(GameInfo *pGameInfo);
|
||||
void Finalize(void);
|
||||
|
||||
private:
|
||||
void ProcesarSecuencia(char *file);
|
||||
|
||||
bool Esperar(Uint32 temps);
|
||||
void FadeIn(char *archivo);
|
||||
void Show(char *archivo);
|
||||
void Print(int x, int y, Uint32 color, char *texto);
|
||||
void Musica(char *archivo, int loop);
|
||||
void FadeOut();
|
||||
void FadeOutWithMusic();
|
||||
|
||||
DrawManager *drawManager;
|
||||
InputManager *inputManager;
|
||||
MusicManager *musicManager;
|
||||
GameInfo *gameInfo;
|
||||
|
||||
SDL_Surface *fondo;
|
||||
SDL_Surface *font;
|
||||
};
|
||||
BIN
arounders.icns
Normal file
BIN
bin/SDL2.dll
Normal file
BIN
bin/SDL2_mixer.dll
Normal file
BIN
bin/libgcc_s_seh-1.dll
Normal file
BIN
bin/libogg-0.dll
Normal file
BIN
bin/libstdc++-6.dll
Normal file
BIN
bin/libwinpthread-1.dll
Normal file
49
const.h
@@ -1,49 +0,0 @@
|
||||
#pragma once
|
||||
#ifndef _CONST_H_
|
||||
|
||||
#define _CONST_H_
|
||||
|
||||
const int SCREEN_WIDTH = 320;
|
||||
const int SCREEN_HEIGHT = 200;
|
||||
const int SCREEN_BPP = 32;
|
||||
const char APPLICATION_NAME[12] = "Arounders";
|
||||
|
||||
const int ESTADO_SALIR = 0;
|
||||
const int ESTADO_INTRO = 1;
|
||||
const int ESTADO_SEQUENCIA = 2;
|
||||
const int ESTADO_MENU = 3;
|
||||
const int ESTADO_PASSWORD = 4;
|
||||
const int ESTADO_PREFASE = 5;
|
||||
const int ESTADO_JUEGO = 6;
|
||||
const int ESTADO_POSTFASE = 7;
|
||||
const int ESTADO_MORT = 8;
|
||||
const int ESTADO_CREDITS = 9;
|
||||
|
||||
const int ACCIO_CAMINAR = 0;
|
||||
const int ACCIO_PARAR = 1;
|
||||
const int ACCIO_CAVAR = 2;
|
||||
const int ACCIO_ESCALAR = 3;
|
||||
const int ACCIO_PERFORAR = 4;
|
||||
const int ACCIO_ESCALERA = 5;
|
||||
const int ACCIO_PASARELA = 6;
|
||||
const int ACCIO_CORDA = 7;
|
||||
const int ACCIO_SUICIDI = 8;
|
||||
const int ACCIO_SUICIDI2 = 9;
|
||||
const int ACCIO_CAURE = 10;
|
||||
const int ACCIO_PUJARCORDA = 11;
|
||||
const int ACCIO_BAIXARCORDA = 12;
|
||||
const int ACCIO_MORT = 13;
|
||||
|
||||
const int DIAPO_ESPERAR = 0;
|
||||
const int DIAPO_FADEIN = 1;
|
||||
const int DIAPO_SHOW = 2;
|
||||
const int DIAPO_PRINT = 3;
|
||||
const int DIAPO_MUSICA = 4;
|
||||
const int DIAPO_FADEOUT = 5;
|
||||
const int DIAPO_FADEMUSIC = 6;
|
||||
|
||||
const int MODE_NORMAL = 0;
|
||||
const int MODE_ZOOMX2 = 1;
|
||||
const int MODE_FULLSCREEN = 2;
|
||||
|
||||
#endif
|
||||
BIN
data/BKG00.GIF
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
data/BKG01.GIF
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
data/BKG02.GIF
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
data/BKG03.GIF
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
data/BKG04.GIF
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
data/BKG05.GIF
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
data/BKG06.GIF
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
data/BKG07.GIF
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
data/BKG08.GIF
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
data/BKG09.GIF
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
data/SEQ11.GIF
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
data/SEQ12.GIF
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
data/SEQ13.GIF
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
data/SEQ14.GIF
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
data/SEQ21.GIF
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
data/SEQ22.GIF
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
data/SEQ31.GIF
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
data/SEQ32.GIF
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
data/SEQ41.GIF
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
data/SEQ42.GIF
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
data/SEQ51.GIF
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
data/SEQ52.GIF
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
data/SEQ61.GIF
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
data/SEQ71.GIF
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
data/SEQ72.GIF
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
data/SEQ73.GIF
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
data/SEQ74.GIF
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
data/THX.GIF
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
data/aigua.gif
Normal file
|
After Width: | Height: | Size: 721 B |
BIN
data/boto.gif
Normal file
|
After Width: | Height: | Size: 479 B |
BIN
data/cursor.gif
Normal file
|
After Width: | Height: | Size: 255 B |
BIN
data/explosio.gif
Normal file
|
After Width: | Height: | Size: 91 B |
BIN
data/final01.GIF
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
data/final02.GIF
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
data/final03.GIF
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
data/final04.GIF
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
data/final05.GIF
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
data/fuente1.gif
Normal file
|
After Width: | Height: | Size: 789 B |
BIN
data/fuente2.gif
Normal file
|
After Width: | Height: | Size: 622 B |
BIN
data/intro01.GIF
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
data/intro02.GIF
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
data/intro03.GIF
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
data/intro04.GIF
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
data/intro05.GIF
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
data/intro06.GIF
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
data/jailgames.gif
Normal file
|
After Width: | Height: | Size: 26 KiB |
900
data/mapes.txt
Normal file
@@ -0,0 +1,900 @@
|
||||
LEVEL 0
|
||||
|
||||
tileset = 0
|
||||
orientacio = 0
|
||||
arounders = 10
|
||||
necessaris = 10
|
||||
|
||||
parar = 1
|
||||
cavar = 2
|
||||
escalar = 0
|
||||
perforar = 0
|
||||
escalera = 0
|
||||
pasarela = 0
|
||||
corda = 0
|
||||
|
||||
inici = 2 1
|
||||
final = 2 7
|
||||
|
||||
0 8 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 0
|
||||
0 4 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0
|
||||
0 1 2 2 2 2 5 2 2 2 3 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 1 2 2 5 2 2 2 2 3 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0
|
||||
0 8 0 0 0 0 0 0 0 1 2 2 2 2 2 2 2 5 3 0
|
||||
0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0
|
||||
0 1 5 2 2 2 2 2 2 5 2 2 2 2 2 2 2 5 3 0
|
||||
0 0 4 0 0 0 0 0 0 4 0 0 0 0 0 0 0 4 0 0
|
||||
|
||||
|
||||
LEVEL 1
|
||||
|
||||
tileset = 2
|
||||
orientacio = 0
|
||||
arounders = 10
|
||||
necessaris = 10
|
||||
|
||||
parar = 3
|
||||
cavar = 2
|
||||
escalar = 0
|
||||
perforar = 0
|
||||
escalera = 0
|
||||
pasarela = 0
|
||||
corda = 1
|
||||
|
||||
inici = 3 1
|
||||
final = 1 8
|
||||
|
||||
0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 7 2 2 2 2 2 2 2 2 2 2 2 2 2 2 9 0 0
|
||||
0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0
|
||||
0 0 8 2 2 2 2 2 2 2 2 2 2 2 2 2 2 10 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 7 2 2 2 2 2 2 2 2 3 0
|
||||
0 1 2 2 2 2 2 2 2 9 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 7 2 2 2 2 2 2 2 2 3 0
|
||||
0 1 2 2 2 2 2 2 2 10 0 0 0 0 0 0 0 0 0 0
|
||||
|
||||
|
||||
LEVEL 2
|
||||
|
||||
tileset = 4
|
||||
orientacio = 8
|
||||
arounders = 10
|
||||
necessaris = 9
|
||||
|
||||
parar = 2
|
||||
cavar = 5
|
||||
escalar = 0
|
||||
perforar = 0
|
||||
escalera = 20
|
||||
pasarela = 20
|
||||
corda = 0
|
||||
|
||||
inici = 11 3
|
||||
final = 1 6
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 5 6 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 1 2 0 0 7 8 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 10 9 9 9 9 9 9 9 5 6 9 9 9 11 0 0 0 0
|
||||
0 0 5 6 0 4 0 0 0 0 7 8 0 0 0 13 0 0 0 0
|
||||
0 0 7 8 0 3 0 1 2 0 10 9 11 0 4 13 0 4 0 0
|
||||
0 10 9 9 9 9 9 9 9 11 12 0 13 0 3 13 0 3 0 0
|
||||
0 12 12 0 0 0 0 0 0 13 12 0 10 9 9 9 9 11 0 0
|
||||
0 12 12 0 0 0 0 0 0 13 12 0 12 13 0 13 0 13 0 0
|
||||
|
||||
|
||||
LEVEL 3
|
||||
|
||||
tileset = 1
|
||||
orientacio = 0
|
||||
arounders = 12
|
||||
necessaris = 10
|
||||
|
||||
parar = 1
|
||||
cavar = 1
|
||||
escalar = 0
|
||||
perforar = 1
|
||||
escalera = 40
|
||||
pasarela = 0
|
||||
corda = 0
|
||||
|
||||
inici = 2 3
|
||||
final = 13 6
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 3 2 2 4 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 5 5 0 0 0 0 0 0 0 0 0 0
|
||||
0 3 2 2 4 0 0 0 5 5 0 3 2 2 2 2 4 0 0 0
|
||||
0 0 5 5 0 6 0 0 5 5 1 1 1 1 1 1 0 0 0 0
|
||||
0 0 5 5 3 2 2 4 0 0 0 1 1 0 0 0 0 0 0 0
|
||||
0 0 5 5 0 5 5 0 3 2 2 1 1 2 2 2 2 4 0 0
|
||||
0 0 5 5 0 5 5 0 0 1 1 1 1 1 1 1 1 0 0 0
|
||||
0 0 5 5 0 5 5 0 0 1 1 1 1 1 1 1 1 0 0 0
|
||||
|
||||
|
||||
LEVEL 4
|
||||
|
||||
tileset = 5
|
||||
orientacio = 8
|
||||
arounders = 15
|
||||
necessaris = 15
|
||||
|
||||
parar = 0
|
||||
cavar = 0
|
||||
escalar = 2
|
||||
perforar = 3
|
||||
escalera = 18
|
||||
pasarela = 0
|
||||
corda = 2
|
||||
|
||||
inici = 16 2
|
||||
final = 5 8
|
||||
|
||||
11 1 1 3 2 1 1 3 2 3 3 1 3 2 0 0 0 0 0 12
|
||||
18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17
|
||||
18 0 0 0 0 0 0 0 0 0 0 14 8 4 6 20 0 14 13 17
|
||||
18 0 0 0 0 0 0 0 0 0 0 15 1 15 2 3 1 2 16 17
|
||||
9 5 6 5 6 8 6 8 6 5 6 8 13 0 0 0 0 0 0 17
|
||||
19 11 1 1 2 3 3 1 12 11 1 3 16 0 0 0 0 0 14 10
|
||||
19 9 8 5 6 6 5 6 10 9 5 6 13 0 0 0 0 0 15 12
|
||||
19 19 19 11 1 1 2 3 16 2 1 1 16 14 8 5 6 8 8 10
|
||||
19 19 19 9 20 0 14 5 6 13 0 0 0 15 3 2 1 1 3 12
|
||||
19 19 19 11 2 3 1 1 2 16 0 0 0 0 0 0 0 0 0 17
|
||||
|
||||
|
||||
LEVEL 5
|
||||
|
||||
tileset = 0
|
||||
orientacio = 8
|
||||
arounders = 10
|
||||
necessaris = 10
|
||||
|
||||
parar = 3
|
||||
cavar = 1
|
||||
escalar = 0
|
||||
perforar = 0
|
||||
escalera = 40
|
||||
pasarela = 0
|
||||
corda = 0
|
||||
|
||||
inici = 4 1
|
||||
final = 18 8
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
8 0 1 5 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
4 0 0 4 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
1 2 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 6 0 0 0 0 0 0 0 0 8 0 0 0 0 0
|
||||
0 0 0 0 0 0 6 0 0 0 0 0 0 0 4 0 0 0 0 8
|
||||
0 0 0 0 0 0 0 8 0 0 0 7 0 1 5 3 0 0 0 4
|
||||
0 0 0 0 0 0 0 4 1 5 5 3 0 0 4 0 0 5 5 5
|
||||
|
||||
|
||||
LEVEL 6
|
||||
|
||||
tileset = 1
|
||||
orientacio = 8
|
||||
arounders = 15
|
||||
necessaris = 15
|
||||
|
||||
parar = 1
|
||||
cavar = 0
|
||||
escalar = 2
|
||||
perforar = 0
|
||||
escalera = 40
|
||||
pasarela = 8
|
||||
corda = 1
|
||||
|
||||
inici = 18 8
|
||||
final = 18 1
|
||||
|
||||
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
|
||||
1 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
|
||||
1 1 8 0 0 0 0 1 1 1 1 1 1 0 1 1 1 1 1 1
|
||||
1 1 1 8 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1
|
||||
1 1 1 1 8 0 1 1 1 1 1 0 0 0 0 0 0 0 0 1
|
||||
1 1 1 1 1 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1
|
||||
1 1 1 1 1 1 8 0 0 0 0 7 1 0 0 0 0 0 0 1
|
||||
1 1 1 1 1 1 1 8 0 0 7 1 1 0 0 0 0 0 0 1
|
||||
1 1 1 1 1 1 1 1 8 7 1 1 1 0 0 0 0 0 0 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
|
||||
|
||||
LEVEL 7
|
||||
|
||||
tileset = 0
|
||||
orientacio = 0
|
||||
arounders = 10
|
||||
necessaris = 10
|
||||
|
||||
parar = 1
|
||||
cavar = 1
|
||||
escalar = 0
|
||||
perforar = 2
|
||||
escalera = 0
|
||||
pasarela = 0
|
||||
corda = 0
|
||||
|
||||
inici = 4 0
|
||||
final = 4 8
|
||||
|
||||
0 0 4 4 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0
|
||||
0 0 1 2 2 2 2 2 2 5 2 2 2 2 2 2 3 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0
|
||||
0 1 5 3 0 0 0 0 0 1 2 2 2 2 2 2 3 0 0 0
|
||||
0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 1 2 2 2 2 2 5 3 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 1 5 2 2 2 2 5 5 2 2 2 2 2 5 3 0 0 0
|
||||
0 0 0 4 0 0 0 0 4 4 0 0 0 0 0 4 0 0 0 0
|
||||
0 0 1 5 5 5 5 5 5 5 5 5 5 5 5 5 3 0 0 0
|
||||
|
||||
|
||||
LEVEL 8
|
||||
|
||||
tileset = 4
|
||||
orientacio = 8
|
||||
arounders = 15
|
||||
necessaris = 14
|
||||
|
||||
parar = 3
|
||||
cavar = 1
|
||||
escalar = 2
|
||||
perforar = 2
|
||||
escalera = 0
|
||||
pasarela = 0
|
||||
corda = 2
|
||||
|
||||
inici = 10 0
|
||||
final = 4 7
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 10 9 11 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 12 0 13 10 11 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 10 11 0 0 13 0 0 10 11 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 12 0 13 0 0 0 0 10 11 0 0 0
|
||||
0 0 0 0 0 10 9 9 9 9 9 9 9 9 11 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 13 0 0 0 0 0 10 9 11 0
|
||||
0 0 0 0 0 0 0 0 0 11 13 10 9 9 11 0 0 0 0 0
|
||||
0 0 0 0 10 9 9 9 11 13 13 12 0 0 13 10 11 0 0 0
|
||||
0 0 0 0 12 0 0 0 13 13 13 12 0 0 13 0 0 0 0 0
|
||||
|
||||
|
||||
LEVEL 9
|
||||
|
||||
tileset = 5
|
||||
orientacio = 0
|
||||
arounders = 15
|
||||
necessaris = 15
|
||||
|
||||
parar = 3
|
||||
cavar = 0
|
||||
escalar = 1
|
||||
perforar = 1
|
||||
escalera = 99
|
||||
pasarela = 99
|
||||
corda = 1
|
||||
|
||||
inici = 1 8
|
||||
final = 1 2
|
||||
|
||||
9 5 6 13 0 15 1 2 1 3 3 1 2 1 3 1 1 3 2 12
|
||||
11 1 1 16 0 0 0 0 0 0 0 0 14 8 7 8 13 0 0 17
|
||||
9 0 14 8 7 5 6 13 0 0 0 0 15 1 2 3 16 14 8 10
|
||||
11 2 1 2 3 2 1 16 0 0 0 0 0 0 0 0 14 15 2 12
|
||||
18 0 0 0 0 0 14 5 6 8 6 8 8 6 20 0 16 0 14 10
|
||||
9 8 13 0 0 0 15 1 1 1 1 1 1 1 1 6 20 0 15 12
|
||||
11 2 16 14 20 0 14 0 0 0 0 0 0 0 0 15 16 14 8 10
|
||||
18 0 0 15 16 0 16 14 8 6 8 20 0 0 0 0 0 15 2 12
|
||||
9 0 14 8 5 6 13 15 1 2 1 16 14 4 6 8 20 14 8 10
|
||||
11 1 2 3 3 2 16 0 0 0 0 0 15 1 12 11 2 3 2 1
|
||||
|
||||
|
||||
LEVEL 10
|
||||
|
||||
tileset = 3
|
||||
orientacio = 0
|
||||
arounders = 12
|
||||
necessaris = 11
|
||||
|
||||
parar = 1
|
||||
cavar = 0
|
||||
escalar = 2
|
||||
perforar = 0
|
||||
escalera = 16
|
||||
pasarela = 0
|
||||
corda = 4
|
||||
|
||||
inici = 9 0
|
||||
final = 9 4
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
|
||||
0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
|
||||
0 0 0 1 0 1 1 1 1 0 0 1 1 1 0 0 1 0 0 0
|
||||
0 0 0 1 0 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0
|
||||
0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0
|
||||
0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0
|
||||
0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
|
||||
|
||||
LEVEL 11
|
||||
|
||||
tileset = 2
|
||||
orientacio = 0
|
||||
arounders = 12
|
||||
necessaris = 12
|
||||
|
||||
parar = 1
|
||||
cavar = 0
|
||||
escalar = 1
|
||||
perforar = 1
|
||||
escalera = 45
|
||||
pasarela = 6
|
||||
corda = 1
|
||||
|
||||
inici = 3 5
|
||||
final = 12 4
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 5 13 13 13 13 13 13 13 13 13 13 13 13 0 0 0 0 0
|
||||
0 0 5 13 13 13 13 13 13 13 13 13 13 13 0 0 0 0 0 6
|
||||
0 0 5 0 0 0 0 0 0 0 0 0 0 0 1 2 2 7 2 9
|
||||
0 0 5 0 0 0 0 0 0 0 0 18 19 0 0 0 0 5 0 4
|
||||
0 0 5 1 3 0 0 0 0 0 0 17 20 0 0 0 0 5 0 0
|
||||
11 0 5 0 0 13 13 13 13 0 0 17 20 0 0 0 0 5 0 0
|
||||
15 0 5 0 0 0 0 0 0 0 0 16 20 0 0 0 0 4 0 0
|
||||
14 13 13 13 13 14 13 13 13 13 13 13 20 13 13 13 13 14 13 0
|
||||
|
||||
|
||||
LEVEL 12
|
||||
|
||||
tileset = 1
|
||||
orientacio = 8
|
||||
arounders = 15
|
||||
necessaris = 11
|
||||
|
||||
parar = 1
|
||||
cavar = 0
|
||||
escalar = 0
|
||||
perforar = 0
|
||||
escalera = 40
|
||||
pasarela = 20
|
||||
corda = 0
|
||||
|
||||
inici = 18 4
|
||||
final = 3 8
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 2 2 2 2 2 2 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 2 1 1 1 1 1 1 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 2 1 1 1 1 1 1 1 2 2 2 2 2 2 2 0
|
||||
0 0 0 0 0 6 0 0 0 0 0 0 0 6 0 0 0 0 6 0
|
||||
0 0 0 2 2 2 2 2 2 2 2 2 2 2 2 0 0 2 2 0
|
||||
0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 0
|
||||
0 0 0 1 1 1 1 1 1 1 1 10 0 0 7 1 1 1 1 0
|
||||
|
||||
|
||||
LEVEL 13
|
||||
|
||||
tileset = 4
|
||||
orientacio = 0
|
||||
arounders = 10
|
||||
necessaris = 10
|
||||
|
||||
parar = 0
|
||||
cavar = 1
|
||||
escalar = 11
|
||||
perforar = 1
|
||||
escalera = 0
|
||||
pasarela = 8
|
||||
corda = 0
|
||||
|
||||
inici = 2 7
|
||||
final = 17 8
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 13 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 13 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 4 4 0 0 13 0 10 11 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 3 3 10 11 13 0 12 13 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 4 4 12 13 13 4 12 13 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 3 3 12 13 13 3 12 13 10 11 0 0 0 0 0 0
|
||||
0 0 5 6 4 4 0 0 0 0 0 0 0 0 10 11 0 0 0 0
|
||||
0 0 7 8 3 3 10 9 9 9 9 9 9 9 9 9 9 11 0 0
|
||||
|
||||
|
||||
LEVEL 14
|
||||
|
||||
tileset = 5
|
||||
orientacio = 0
|
||||
arounders = 14
|
||||
necessaris = 13
|
||||
|
||||
parar = 1
|
||||
cavar = 1
|
||||
escalar = 0
|
||||
perforar = 1
|
||||
escalera = 99
|
||||
pasarela = 10
|
||||
corda = 3
|
||||
|
||||
inici = 2 2
|
||||
final = 18 8
|
||||
|
||||
11 1 2 3 1 1 2 3 3 12 11 3 2 1 2 1 3 2 1 12
|
||||
18 0 0 0 0 0 0 0 0 17 18 0 0 0 0 0 0 0 0 17
|
||||
9 20 0 14 13 0 0 0 0 17 18 0 0 0 0 0 0 0 0 17
|
||||
11 1 1 2 16 0 0 0 0 17 18 0 0 0 0 0 0 0 0 17
|
||||
18 0 0 0 14 13 0 0 0 17 18 0 0 14 8 8 8 13 0 17
|
||||
9 13 0 0 12 11 0 0 0 17 9 8 13 15 3 12 11 16 0 17
|
||||
11 16 0 0 10 9 8 7 13 17 11 2 16 14 8 10 9 13 0 17
|
||||
18 0 0 0 2 1 3 2 16 17 18 0 0 15 2 12 11 16 0 17
|
||||
9 8 20 0 14 6 5 6 8 10 9 8 6 5 6 10 9 8 0 10
|
||||
11 2 16 0 2 3 2 3 1 12 11 3 2 3 1 1 3 3 2 12
|
||||
|
||||
|
||||
LEVEL 15
|
||||
|
||||
tileset = 0
|
||||
orientacio = 8
|
||||
arounders = 5
|
||||
necessaris = 5
|
||||
|
||||
parar = 1
|
||||
cavar = 0
|
||||
escalar = 0
|
||||
perforar = 0
|
||||
escalera = 99
|
||||
pasarela = 0
|
||||
corda = 0
|
||||
|
||||
inici = 5 4
|
||||
final = 7 5
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
8 0 0 0 0 1 5 3 0 0 0 0 1 5 3 0 0 0 0 0
|
||||
4 0 0 0 0 0 4 0 0 0 0 0 0 4 0 0 0 0 0 0
|
||||
1 2 2 9 0 0 1 2 2 2 2 2 2 3 1 5 3 0 0 0
|
||||
0 0 0 12 2 3 0 0 0 0 0 0 0 0 0 4 0 0 0 0
|
||||
0 0 0 0 0 0 0 1 3 0 0 0 0 0 1 2 2 3 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 10 2 2 2 2 2 2 2 3 0
|
||||
0 0 0 0 0 0 0 1 2 2 11 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
|
||||
|
||||
LEVEL 16
|
||||
|
||||
tileset = 4
|
||||
orientacio = 0
|
||||
arounders = 15
|
||||
necessaris = 15
|
||||
|
||||
parar = 0
|
||||
cavar = 1
|
||||
escalar = 2
|
||||
perforar = 0
|
||||
escalera = 0
|
||||
pasarela = 18
|
||||
corda = 0
|
||||
|
||||
inici = 4 5
|
||||
final = 18 8
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 4 0 5 6 0 4 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 1 2 3 0 7 8 0 3 0 1 2 0 0 0 0 0 0 0
|
||||
0 0 10 9 9 9 9 9 9 9 9 9 9 11 0 0 0 0 0 0
|
||||
0 0 12 0 0 0 0 0 0 0 0 0 0 13 0 10 9 9 9 9
|
||||
|
||||
|
||||
LEVEL 17
|
||||
|
||||
tileset = 0
|
||||
orientacio = 8
|
||||
arounders = 20
|
||||
necessaris = 13
|
||||
|
||||
parar = 0
|
||||
cavar = 0
|
||||
escalar = 0
|
||||
perforar = 0
|
||||
escalera = 60
|
||||
pasarela = 0
|
||||
corda = 0
|
||||
|
||||
inici = 18 7
|
||||
final = 1 7
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 1 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 12 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 12 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
2 2 2 2 2 2 2 5 2 2 9 0 0 0 0 0 0 0 0 0
|
||||
2 2 2 2 2 2 3 4 0 0 12 9 0 0 0 0 0 0 0 0
|
||||
2 2 2 5 3 0 1 5 2 2 3 12 9 0 0 0 0 0 0 0
|
||||
0 0 0 4 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 1 5 2 2 5 2 2 2 5 2 2 2 5 2 2 2 5 3 0
|
||||
0 0 4 0 0 4 0 0 0 4 0 0 0 4 0 0 0 4 0 0
|
||||
|
||||
|
||||
LEVEL 18
|
||||
|
||||
tileset = 1
|
||||
orientacio = 0
|
||||
arounders = 12
|
||||
necessaris = 12
|
||||
|
||||
parar = 0
|
||||
cavar = 1
|
||||
escalar = 0
|
||||
perforar = 0
|
||||
escalera = 20
|
||||
pasarela = 0
|
||||
corda = 0
|
||||
|
||||
inici = 1 4
|
||||
final = 18 6
|
||||
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 10 9 1 1 1 10 9 1 1 1 1 1 1 1 1
|
||||
1 1 10 9 10 7 8 9 1 0 7 8 0 1 1 10 9 1 1 1
|
||||
1 0 7 8 7 1 1 0 0 7 1 1 8 9 10 7 8 9 1 1
|
||||
1 1 1 1 1 1 10 7 8 0 9 1 1 0 7 1 1 8 9 1
|
||||
1 1 1 1 1 10 7 1 10 7 8 9 10 0 0 9 10 0 0 1
|
||||
1 1 1 1 10 0 1 10 0 1 1 0 7 1 1 0 7 1 1 1
|
||||
1 1 1 10 7 8 0 7 0 1 1 0 1 1 1 0 1 1 1 1
|
||||
1 1 10 7 1 1 1 1 0 1 1 0 1 1 1 0 1 1 1 1
|
||||
|
||||
|
||||
LEVEL 19
|
||||
|
||||
tileset = 3
|
||||
orientacio = 8
|
||||
arounders = 2
|
||||
necessaris = 2
|
||||
|
||||
parar = 1
|
||||
cavar = 1
|
||||
escalar = 14
|
||||
perforar = 1
|
||||
escalera = 0
|
||||
pasarela = 0
|
||||
corda = 0
|
||||
|
||||
inici = 7 1
|
||||
final = 19 4
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 2 1 1 1
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 2 1 1 1 1
|
||||
0 0 0 0 0 3 2 2 0 0 0 0 0 3 2 1 1 1 1 1
|
||||
0 0 0 0 0 5 6 0 0 0 0 0 3 2 1 1 1 1 1 1
|
||||
0 0 0 0 3 2 0 0 0 3 2 2 2 1 1 6 0 0 0 0
|
||||
0 0 0 0 5 6 0 0 3 2 1 1 6 0 0 3 2 2 2 2
|
||||
0 0 0 3 6 0 0 0 2 0 0 0 0 3 2 2 1 1 1 1
|
||||
0 0 3 2 6 0 0 3 6 3 2 2 2 2 1 1 1 1 1 1
|
||||
0 3 2 6 0 0 3 6 0 0 5 1 1 1 1 1 1 1 1 1
|
||||
3 2 1 1 2 2 6 0 0 0 0 5 1 1 1 1 1 1 1 1
|
||||
|
||||
|
||||
LEVEL 20
|
||||
|
||||
tileset = 1
|
||||
orientacio = 8
|
||||
arounders = 20
|
||||
necessaris = 20
|
||||
|
||||
parar = 2
|
||||
cavar = 0
|
||||
escalar = 1
|
||||
perforar = 0
|
||||
escalera = 99
|
||||
pasarela = 0
|
||||
corda = 0
|
||||
|
||||
inici = 12 5
|
||||
final = 19 8
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 11 12 0 0 0 0 0 0 0 0 0 0 0 0 3 2 4 0 0
|
||||
0 13 14 0 3 2 2 2 2 2 2 2 2 2 2 4 0 0 0 0
|
||||
3 2 2 4 0 9 1 1 1 1 10 0 0 0 0 0 3 2 4 0
|
||||
0 1 1 1 1 0 1 1 1 10 3 2 2 2 4 0 0 0 0 0
|
||||
0 1 1 1 1 0 9 1 1 0 0 1 1 1 0 0 0 3 2 4
|
||||
0 1 1 1 1 1 0 0 0 3 2 1 1 1 0 0 0 0 0 0
|
||||
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
|
||||
|
||||
LEVEL 21
|
||||
|
||||
tileset = 4
|
||||
orientacio = 8
|
||||
arounders = 10
|
||||
necessaris = 10
|
||||
|
||||
parar = 0
|
||||
cavar = 0
|
||||
escalar = 4
|
||||
perforar = 2
|
||||
escalera = 64
|
||||
pasarela = 8
|
||||
corda = 2
|
||||
|
||||
inici = 7 8
|
||||
final = 9 8
|
||||
|
||||
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
9 9 0 9 9 9 9 9 13 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 12 0 0 0 0 0 0 13 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 12 0 10 11 0 0 0 13 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 12 0 0 0 0 0 0 13 0 0 0 0 0 0 0 0 0 0 0
|
||||
9 11 0 0 0 10 9 11 13 0 0 0 0 0 0 0 0 0 0 0
|
||||
9 9 9 9 0 0 0 0 13 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 12 0 0 0 0 13 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 12 0 0 0 0 13 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 10 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 0
|
||||
|
||||
|
||||
LEVEL 22
|
||||
|
||||
tileset = 2
|
||||
orientacio = 8
|
||||
arounders = 20
|
||||
necessaris = 16
|
||||
|
||||
parar = 0
|
||||
cavar = 0
|
||||
escalar = 4
|
||||
perforar = 0
|
||||
escalera = 32
|
||||
pasarela = 0
|
||||
corda = 2
|
||||
|
||||
inici = 16 2
|
||||
final = 13 8
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 7 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 9 0
|
||||
0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0
|
||||
0 7 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 9 0
|
||||
0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0
|
||||
0 5 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0
|
||||
0 7 2 8 2 2 2 2 2 2 2 2 2 2 2 2 2 2 9 0
|
||||
0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0
|
||||
0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 9 0
|
||||
0 8 2 2 2 2 2 2 2 2 2 2 2 2 2 8 2 2 10 0
|
||||
|
||||
|
||||
LEVEL 23
|
||||
|
||||
tileset = 3
|
||||
orientacio = 8
|
||||
arounders = 10
|
||||
necessaris = 10
|
||||
|
||||
parar = 2
|
||||
cavar = 0
|
||||
escalar = 4
|
||||
perforar = 4
|
||||
escalera = 0
|
||||
pasarela = 0
|
||||
corda = 6
|
||||
|
||||
inici = 8 1
|
||||
final = 18 8
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 3 6 5 4 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 3 6 0 0 5 4 0 0 0 0 2 0 0 0 0
|
||||
0 0 0 0 3 6 0 2 2 2 0 0 0 0 0 1 0 0 0 0
|
||||
0 0 0 3 6 0 2 1 6 5 0 2 0 0 2 1 0 0 0 0
|
||||
0 0 3 6 0 0 1 1 7 2 0 1 0 0 1 1 0 17 14 15
|
||||
0 3 6 0 0 0 1 1 2 1 0 1 0 2 1 1 0 11 12 10
|
||||
3 6 0 0 0 0 0 0 0 0 0 1 0 1 1 1 13 17 0 17
|
||||
6 0 0 0 0 0 2 2 2 2 2 1 2 1 1 1 12 10 10 11
|
||||
|
||||
|
||||
LEVEL 24
|
||||
|
||||
tileset = 5
|
||||
orientacio = 8
|
||||
arounders = 8
|
||||
necessaris = 8
|
||||
|
||||
parar = 1
|
||||
cavar = 0
|
||||
escalar = 0
|
||||
perforar = 1
|
||||
escalera = 32
|
||||
pasarela = 30
|
||||
corda = 1
|
||||
|
||||
inici = 2 0
|
||||
final = 18 6
|
||||
|
||||
18 20 0 14 15 2 1 3 2 3 1 2 3 3 1 2 1 1 12 19
|
||||
18 15 3 16 14 5 6 13 0 0 0 0 0 0 0 0 0 14 10 19
|
||||
18 0 0 0 15 2 1 16 14 8 8 5 6 7 8 13 0 15 2 12
|
||||
18 0 0 0 0 0 0 0 15 1 1 2 1 1 2 16 0 0 0 17
|
||||
18 14 7 7 7 7 7 7 7 7 7 7 7 7 7 13 0 0 0 17
|
||||
9 15 1 2 2 2 1 2 2 2 1 2 2 2 2 16 0 0 0 17
|
||||
19 18 14 7 7 7 7 7 7 7 7 7 7 7 0 0 14 8 0 10
|
||||
19 18 15 3 1 2 2 2 2 1 2 2 2 2 0 0 15 1 2 12
|
||||
19 18 0 0 14 8 5 6 6 8 5 6 8 8 6 8 5 6 8 10
|
||||
19 9 6 13 15 3 2 1 3 2 1 2 3 1 3 1 2 2 1 12
|
||||
|
||||
|
||||
LEVEL 25
|
||||
|
||||
tileset = 0
|
||||
orientacio = 0
|
||||
arounders = 7
|
||||
necessaris = 7
|
||||
|
||||
parar = 0
|
||||
cavar = 1
|
||||
escalar = 0
|
||||
perforar = 1
|
||||
escalera = 64
|
||||
pasarela = 10
|
||||
corda = 2
|
||||
|
||||
inici = 1 1
|
||||
final = 19 5
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
13 13 14 0 13 0 0 0 13 0 0 0 13 0 13 13 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 16 14 0 0 0 0 0 0
|
||||
0 0 0 0 0 14 14 14 0 0 14 0 16 0 0 0 0 0 0 0
|
||||
13 0 14 14 0 0 0 0 0 14 0 0 16 15 0 0 16 0 0 0
|
||||
13 0 0 0 0 0 0 17 14 14 14 0 16 0 0 13 14 13 14 14
|
||||
0 0 0 0 0 0 0 17 14 14 14 14 0 0 0 0 0 0 0 0
|
||||
0 0 0 14 14 14 14 14 0 0 0 0 14 14 14 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
|
||||
|
||||
LEVEL 26
|
||||
|
||||
tileset = 0
|
||||
orientacio = 0
|
||||
arounders = 10
|
||||
necessaris = 10
|
||||
|
||||
parar = 0
|
||||
cavar = 0
|
||||
escalar = 7
|
||||
perforar = 6
|
||||
escalera = 0
|
||||
pasarela = 0
|
||||
corda = 1
|
||||
|
||||
inici = 3 0
|
||||
final = 18 6
|
||||
|
||||
13 13 0 0 0 14 14 14 14 14 14 14 14 13 13 13 13 13 13 13
|
||||
13 13 0 13 0 0 0 0 0 0 0 0 0 16 16 16 16 16 16 17
|
||||
16 0 0 13 13 0 0 0 0 0 0 13 0 16 16 16 16 16 16 17
|
||||
16 0 13 13 13 14 14 14 14 14 14 13 0 16 16 16 16 16 16 17
|
||||
16 14 13 13 13 0 0 0 0 0 0 13 0 14 13 16 16 16 16 17
|
||||
16 0 0 0 13 15 15 15 15 15 15 15 15 16 0 14 13 13 13 17
|
||||
13 15 15 0 13 0 0 0 0 0 0 0 0 14 16 0 0 0 0 17
|
||||
16 0 0 0 13 14 14 14 14 14 14 0 0 0 14 14 14 14 14 13
|
||||
16 0 14 14 14 0 13 0 0 0 0 0 0 0 0 0 0 0 0 17
|
||||
13 15 15 15 15 15 13 14 14 14 14 14 14 14 14 14 14 14 14 13
|
||||
|
||||
|
||||
LEVEL 27
|
||||
|
||||
tileset = 2
|
||||
orientacio = 0
|
||||
arounders = 8
|
||||
necessaris = 7
|
||||
|
||||
parar = 1
|
||||
cavar = 0
|
||||
escalar = 0
|
||||
perforar = 0
|
||||
escalera = 99
|
||||
pasarela = 5
|
||||
corda = -1
|
||||
|
||||
inici = 2 1
|
||||
final = 14 8
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 1 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 6 0 10 0 0 1 3 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 8 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 1 3 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 10 0 0 0 0 0 7 2 9 0 0 0 0 0 0
|
||||
0 0 0 1 2 2 2 2 2 2 2 8 2 8 3 0 0 0 0 0
|
||||
|
||||
|
||||
LEVEL 28
|
||||
|
||||
tileset = 3
|
||||
orientacio = 0
|
||||
arounders = 5
|
||||
necessaris = 5
|
||||
|
||||
parar = 99
|
||||
cavar = 99
|
||||
escalar = 99
|
||||
perforar = 99
|
||||
escalera = 99
|
||||
pasarela = 30
|
||||
corda = 0
|
||||
|
||||
inici = 3 0
|
||||
final = 17 8
|
||||
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 5 6 0 0 0 0 0 0 0 0 0 0 9 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 7 0 0 8 0 0 8 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 8 0 0 0 0 0 8 0 0 0 0 0
|
||||
0 9 0 0 0 0 9 0 0 0 9 0 0 0 0 0 0 9 0 0
|
||||
0 0 0 0 0 8 0 0 0 9 0 0 9 0 9 0 0 8 0 0
|
||||
0 0 0 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 9 0 0 0 0
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 6 0 0
|
||||
|
||||
|
||||
LEVEL 29
|
||||
|
||||
tileset = 0
|
||||
orientacio = 0
|
||||
arounders = 5
|
||||
necessaris = 1
|
||||
|
||||
parar = 0
|
||||
cavar = 0
|
||||
escalar = 0
|
||||
perforar = 0
|
||||
escalera = 0
|
||||
pasarela = 0
|
||||
corda = 0
|
||||
|
||||
inici = 1 8
|
||||
final = 18 8
|
||||
|
||||
13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
|
||||
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13
|
||||
13 0 0 0 17 14 17 17 14 16 17 14 16 17 0 0 0 0 0 13
|
||||
13 0 0 0 17 14 17 17 0 16 17 14 16 17 15 0 0 0 0 13
|
||||
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13
|
||||
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13
|
||||
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13
|
||||
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13
|
||||
13 0 0 0 0 0 0 4 0 4 0 4 0 4 0 0 0 0 0 13
|
||||
13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
|
||||
|
||||
|
||||
BIN
data/marca.gif
Normal file
|
After Width: | Height: | Size: 462 B |
BIN
data/marcador.gif
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
data/menu.gif
Normal file
|
After Width: | Height: | Size: 754 B |
BIN
data/menuprin.gif
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
data/mort.gif
Normal file
|
After Width: | Height: | Size: 3.3 KiB |