- [NEW] Anbernics en el lloc i ja se poden recollir

- [CHG] Canviats uns pixels en les portes
- [NEW] Sequencia de final de joc acabada
- [NEW] Al pillar un booster fa sorollet
- Treballant en el prólogo
This commit is contained in:
2024-10-07 13:35:01 +02:00
parent f38d50e7f9
commit fa97ea79e8
30 changed files with 411 additions and 61 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
data/end1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
data/end2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -4,6 +4,8 @@ altres.gif
batman.gif
caixes.gif
doors.gif
end1.gif
end2.gif
floor.gif
font.gif
font2.gif

View File

@@ -28,13 +28,13 @@ actor{
}
actor{
name: ANBERNIC
name: ANBERNIC0
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 56 16 0
size: 6 4 2
flags: PUSHABLE GRAVITY
flags: SPECIAL
movement: CW
}

View File

@@ -11,13 +11,13 @@ exit-zp: 21
editor-done: 1
actor{
name: ANBERNIC
name: ANBERNIC1
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 24 40 8
size: 6 4 2
flags: PUSHABLE GRAVITY
flags: SPECIAL
movement: CW
}

View File

@@ -26,13 +26,13 @@ actor{
}
actor{
name: ANBERNIC
name: ANBERNIC2
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -6 10
pos: 40 8 6
size: 6 4 2
flags: PUSHABLE GRAVITY
flags: SPECIAL
movement: CW
}

View File

@@ -13,6 +13,17 @@ exit-yp: 35
exit-yn: 29
editor-done: 1
actor{
name: ANBERNIC3
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 0 8 0
size: 6 4 2
flags: SPECIAL
movement: CW
}
actor{
name: BLOCMATA-00
bmp: altres.gif

View File

@@ -14,13 +14,13 @@ exit-yn: 32
editor-done: 1
actor{
name: ANBERNIC
name: ANBERNIC4
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 24 32 0
size: 6 4 2
flags: PUSHABLE GRAVITY
flags: SPECIAL
movement: CW
}

View File

@@ -12,13 +12,13 @@ exit-yn: 33
editor-done: 1
actor{
name: ANBERNIC
name: ANBERNIC5
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 40 16 0
size: 6 4 2
flags: PUSHABLE GRAVITY
flags: SPECIAL
movement: CW
}

View File

@@ -12,13 +12,13 @@ exit-yp: 37
editor-done: 1
actor{
name: ANBERNIC
name: ANBERNIC6
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 0 8 0
size: 6 4 2
flags: PUSHABLE GRAVITY
flags: SPECIAL
movement: CW
}
@@ -47,7 +47,7 @@ actor{
bmp: doors.gif
bmp-rect: 160 7 16 40
bmp-offset: -8 47
pos: 8 16 0
pos: 10 18 0
size: 6 6 14
movement: CW
}

View File

@@ -10,21 +10,6 @@ exit-yn: 42
exit-zn: 47
editor-done: 1
actor{
name: ABAD
bmp: lordabad.gif
bmp-rect: 0 0 20 33
bmp-offset: -6 38
pos: 2 28 20
size: 8 8 8
orient: XP
anim-cycle: MIN
anim-wait: 1
flags: ANIMATED ORIENTABLE
react-mask: XP XN YP YN ZP ZN
movement: CCW
}
actor{
name: LIFT-00
bmp: caixes.gif
@@ -47,6 +32,21 @@ actor{
movement: Z
}
actor{
name: LORD-ABAD
bmp: lordabad.gif
bmp-rect: 0 0 20 33
bmp-offset: -6 38
pos: 2 28 20
size: 8 8 8
orient: XP
anim-cycle: MIN
anim-wait: 1
flags: ANIMATED ORIENTABLE
react-mask: XP XN YP YN ZP ZN
movement: CCW
}
actor{
name: PLATH-00
bmp: caixes.gif

View File

@@ -14,7 +14,7 @@ actor{
name: BOX-A
bmp: sam.gif
bmp-rect: 0 0 19 33
bmp-offset: -7 37
bmp-offset: -10 38
pos: 27 0 19
size: 8 8 8
anim-cycle: DUO
@@ -37,8 +37,8 @@ actor{
actor{
name: PLATH-00
bmp: caixes.gif
bmp-rect: 128 128 32 32
bmp-offset: 0 32
bmp-rect: 32 32 32 32
bmp-offset: 0 24
pos: 24 0 15
size: 8 8 4
orient: ZP
@@ -59,8 +59,8 @@ actor{
actor{
name: PLATH-01
bmp: caixes.gif
bmp-rect: 128 128 32 32
bmp-offset: 0 32
bmp-rect: 32 32 32 32
bmp-offset: 0 24
pos: 32 0 15
size: 8 8 4
orient: ZP

View File

@@ -10,6 +10,17 @@ exit-yp: 52
exit-zp: 47
editor-done: 1
actor{
name: ANBERNIC7
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 8 40 0
size: 6 4 2
flags: SPECIAL
movement: CW
}
actor{
name: CADIRA
bmp: caixes.gif

View File

@@ -10,13 +10,13 @@ exit-yn: 59
editor-done: 1
actor{
name: ANBERNIC
name: ANBERNIC8
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 48 40 0
size: 6 4 2
flags: PUSHABLE GRAVITY
flags: SPECIAL
movement: CW
}

View File

@@ -10,13 +10,13 @@ exit-xp: 59
editor-done: 1
actor{
name: ANBERNIC
name: ANBERNIC9
bmp: altres.gif
bmp-rect: 157 80 24 14
bmp-offset: -4 16
pos: 0 40 0
size: 6 4 2
flags: PUSHABLE GRAVITY
flags: SPECIAL
movement: CW
}

View File

@@ -204,6 +204,75 @@ category{
movement: CW
}
actor{
name: SAM
bmp: sam.gif
bmp-rect: 0 0 19 33
bmp-offset: -8 38
pos: 24 40 0
size: 8 8 8
orient: XP
anim-cycle: DUO
anim-wait: 20
flags: ANIMATED
react-mask: XP XN YP YN ZP ZN
movement: CCW
}
actor{
name: YONKI
bmp: caixes.gif
bmp-rect: 168 65 19 31
bmp-offset: -6 36
pos: 24 40 0
size: 8 8 8
orient: XP
anim-wait: 20
react-mask: XP XN YP YN ZP ZN
movement: CCW
}
actor{
name: LORD-ABAD
bmp: lordabad.gif
bmp-rect: 0 0 20 33
bmp-offset: -6 38
pos: 56 48 0
size: 8 8 8
orient: XP
anim-cycle: MIN
anim-wait: 1
flags: ANIMATED ORIENTABLE
react-mask: XP XN YP YN ZP ZN
movement: CCW
}
actor{
name: JAILDES
bmp: test.gif
bmp-rect: 0 32 20 32
bmp-offset: -6 38
pos: 48 40 0
size: 8 8 8
orient: XP
anim-wait: 1
flags: ANIMATED
react-mask: XP XN YP YN ZP ZN
movement: CCW
}
actor{
name: ROOMBA2
bmp: caixes.gif
bmp-rect: 164 0 24 32
bmp-offset: 0 34
pos: 24 40 0
size: 8 8 2
orient: XN
react-mask: XP XN YP YN ZP ZN
movement: CCW
}
}
category{

View File

@@ -650,6 +650,7 @@ namespace actor
if (act->name[0] == 'B')
{ // Es un booster
hero::collectBooster(&act->name[5], (act->name[2] - 48) * 10 + (act->name[3] - 48));
audio::playSound("snd_boost.wav", SOUND_BASIC);
}
else if (act->name[0] == 'S')
{ // Es un skill
@@ -669,6 +670,11 @@ namespace actor
return result;
}
}
else if (act->name[0] == 'A')
{
hero::pickAnbernic(act->name);
audio::playSound("snd_pick.wav", SOUND_BASIC);
}
else
{
SDL_assert(false);
@@ -727,7 +733,7 @@ namespace actor
act->push |= PUSH_XP;
}
}
else if (controller::down(KEY_UP)) //input::keyDown(SDL_SCANCODE_UP) || input::keyDown(config::getKey(KEY_UP)))
else if (controller::down(KEY_UP)) // input::keyDown(SDL_SCANCODE_UP) || input::keyDown(config::getKey(KEY_UP)))
{
hero::useBoostRun();
act->orient = PUSH_YN;
@@ -747,7 +753,7 @@ namespace actor
act->push |= PUSH_YN;
}
}
else if (controller::down(KEY_DOWN)) //input::keyDown(SDL_SCANCODE_DOWN) || input::keyDown(config::getKey(KEY_DOWN)))
else if (controller::down(KEY_DOWN)) // input::keyDown(SDL_SCANCODE_DOWN) || input::keyDown(config::getKey(KEY_DOWN)))
{
hero::useBoostRun();
act->orient = PUSH_YP;
@@ -767,7 +773,7 @@ namespace actor
act->push |= PUSH_YP;
}
}
//if ((input::keyPressed(SDL_SCANCODE_RETURN) || input::keyPressed(config::getKey(KEY_PICK))) && (hero::getSkills() & SKILL_PANTS))
// if ((input::keyPressed(SDL_SCANCODE_RETURN) || input::keyPressed(config::getKey(KEY_PICK))) && (hero::getSkills() & SKILL_PANTS))
if ((controller::pressed(KEY_PICK)) && (hero::getSkills() & SKILL_PANTS))
{
if (picked)
@@ -815,7 +821,7 @@ namespace actor
}
}
actor::actor_t *future_below = any_below_me(act);
//if ((input::keyDown(SDL_SCANCODE_SPACE) || input::keyDown(config::getKey(KEY_JUMP))) &&
// if ((input::keyDown(SDL_SCANCODE_SPACE) || input::keyDown(config::getKey(KEY_JUMP))) &&
if ((controller::down(KEY_JUMP)) &&
(hero::getSkills() & SKILL_SHOES) && (act->pos.y + act->size.y) <= max.y && act->pos.y >= min.y && (act->pos.x + act->size.x) <= max.x && act->pos.x >= min.x && act->react_mask == 0 && ((act->pos.z == 0 && room::getFloor() != 11) || (act->below || future_below)))
{
@@ -869,7 +875,8 @@ namespace actor
if (moving)
{
act->flags |= FLAG_ANIMATED;
if ((config::getSoundMode()==SOUND_ALL) && act->react_mask==0 && ( (act->below) || (act->pos.z==0) )) audio::resumeChannel(walk_channel);
if ((config::getSoundMode() == SOUND_ALL) && act->react_mask == 0 && ((act->below) || (act->pos.z == 0)))
audio::resumeChannel(walk_channel);
}
else
{
@@ -885,7 +892,7 @@ namespace actor
act->push |= act->mov_push;
}
void changeMoving(actor_t *act, const bool silent=false)
void changeMoving(actor_t *act, const bool silent = false)
{
if (!silent && !push_sound_already_playing)
{
@@ -1035,7 +1042,11 @@ namespace actor
act2->anim_frame = 2;
act->anim_wait = act2->anim_wait = 1;
actor_t *other = first;
while (other) { other->flags &= ~FLAG_MOVING; other = other->next; }
while (other)
{
other->flags &= ~FLAG_MOVING;
other = other->next;
}
actor::setDirty(act2);
room::cycleColor(4);
return;
@@ -1488,7 +1499,7 @@ namespace actor
draw::stencil::set(act->tag);
draw::draw(x, y, act->bmp_rect.w, act->bmp_rect.h, act->bmp_rect.x + ao, act->bmp_rect.y + oo, flip);
draw::swapcol(1, room::getColor(0)); // Tornem al color per defecte
if (act->flags & FLAG_SPECIAL)
if ((act->flags & FLAG_SPECIAL) && (act->name[0] != 'A'))
{
draw::setSource(brilli);
const int dx = (act->bmp_rect.w - 22) >> 1;
@@ -1898,6 +1909,7 @@ namespace actor
int skills = SKILL_NONE;
int parts = PART_NONE;
bool boosters_collected[100];
bool anbernics[10] = {false, false, false, false, false, false, false, false, false, false};
vec3_t first_pos = {0, 0, 0};
int first_orient = 0;
bool dead = false;
@@ -1917,10 +1929,13 @@ namespace actor
lives = 8;
skills = SKILL_NONE;
parts = PART_NONE;
for (int i = 0; i < 10; ++i)
anbernics[i] = false;
for (int i = 0; i < 100; ++i)
boosters_collected[i] = false;
brilli = draw::getSurface("objectes.gif");
if ( (config::getSoundMode()==SOUND_ALL) ) {
if ((config::getSoundMode() == SOUND_ALL))
{
walk_channel = audio::playSound("snd_walk.wav", SOUND_ALL, -1);
audio::pauseChannel(walk_channel);
}
@@ -2181,6 +2196,25 @@ namespace actor
return parts;
}
void pickAnbernic(char *name)
{
anbernics[name[8] - 48] = true;
}
bool wasAnbernicCollected(char *name)
{
return anbernics[name[8] - 48];
}
int getNumAmbernicsCollected()
{
int count = 0;
for (auto anbernic : anbernics)
if (anbernic)
count++;
return count;
}
void move(int *x, int *y, int *z)
{
actor_t *hero = actor::find("HERO");

View File

@@ -233,6 +233,10 @@ namespace actor
bool wasPartCollected(char *part);
int getParts();
void pickAnbernic(char *name);
bool wasAnbernicCollected(char *name);
int getNumAmbernicsCollected();
void move(int *x, int *y, int *z);
void setFirstPos();
}

View File

@@ -8,6 +8,7 @@ namespace config
int soundMode = SOUND_ALL;
uint8_t keys[7] = {SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_SPACE, SDL_SCANCODE_RETURN, SDL_SCANCODE_ESCAPE};
int8_t pad_btns[7] = {SDL_CONTROLLER_BUTTON_DPAD_UP, SDL_CONTROLLER_BUTTON_DPAD_DOWN, SDL_CONTROLLER_BUTTON_DPAD_LEFT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, SDL_CONTROLLER_BUTTON_A, SDL_CONTROLLER_BUTTON_B, SDL_CONTROLLER_BUTTON_START};
bool prologo_desbloquejat = false;
void setMusic(const bool value)
{
@@ -69,4 +70,16 @@ namespace config
{
return pad_btns[which];
}
void setProgoloDesbloquejat()
{
prologo_desbloquejat = true;
file::setConfigValue("prologo", "unlocked");
}
const bool isProgoloDesbloquejat()
{
return prologo_desbloquejat;
}
}

View File

@@ -28,4 +28,6 @@ namespace config
void definePadBtn(const int which, const int btn);
const int getPadBtn(const int which);
void setProgoloDesbloquejat();
const bool isProgoloDesbloquejat();
}

138
source/m_end_sequence.cpp Normal file
View File

@@ -0,0 +1,138 @@
#include "m_intro.h"
#include "jgame.h"
#include "jdraw.h"
#include "jinput.h"
#include "jaudio.h"
#include "controller.h"
#include "config.h"
#include <SDL2/SDL.h>
#include "actor.h"
namespace modules
{
namespace end_sequence
{
int stage = 0;
uint32_t time = 0;
actor::actor_t *act = nullptr;
const char *actor_names[] = {"JAILDESIGNER", "BATMAN", "ROBIN", "EL ALTRE BATMAN", "EL ABAD", "LA ROOMBA", "EL OBRER", "BAMBOLLA DE CAFE", "EL YONKI", "LA PILOTA", "SAM", "LORD ABAD"};
const char *actor_ids[] = {"JAILDES", "GAT-BATMAN", "GAT-ROBIN", "BATMAN", "ABAD", "ROOMBA2", "OBRER", "COFFEE", "YONKI", "PILOTA", "SAM", "LORD-ABAD"};
void init()
{
time = SDL_GetTicks();
draw::restorecol(2);
draw::cls(2);
draw::swapcol(1, 7);
draw::setSource(draw::getSurface("end1.gif"));
draw::draw(96, 28, 128, 96, 0, 0);
draw::print2("PER FI! JA PUC", 13, 17, WHITE, FONT_ZOOM_NONE);
draw::print2("TASTAR LA PISCINA!", 11, 19, WHITE, FONT_ZOOM_NONE);
draw::render();
if (audio::getCurrentMusic() != "mus_menu.ogg") audio::playMusic("mus_menu.ogg");
actor::templates::load();
}
const bool shouldGoToNext()
{
return (SDL_GetTicks()-time > (stage==15||stage==16?10000:5000)) ||
(controller::pressed(KEY_JUMP)) || (controller::pressed(KEY_PICK)) ||
(input::keyPressed(SDL_SCANCODE_SPACE)) || (input::keyPressed(SDL_SCANCODE_RETURN));
}
void drawActorAt(const char* name, const int x, const int y)
{
draw::swapcol(1,YELLOW);
actor::actor_t *act = actor::createFromTemplate(name);
//act->flags &= ~FLAG_SPECIAL;
actor::drawAt(act, x, y); actor::remove(act);
}
bool loop()
{
if (controller::pressed(KEY_MENU)) return false;
if (shouldGoToNext())
{
time = SDL_GetTicks();
stage++;
if ( (stage==2) && (config::isProgoloDesbloquejat()) ) stage++;
if (stage == 17) return false;
switch (stage)
{
case 1:
draw::cls(2);
draw::swapcol(1, 8);
draw::setSource(draw::getSurface("end2.gif"));
draw::draw(96, 28, 128, 96, 0, 0);
draw::print2("PUTA, QUE GUST...", 12, 17, WHITE, FONT_ZOOM_NONE);
//draw::render();
break;
case 2:
draw::cls(2);
draw::swapcol(1, 8);
draw::setSource(draw::getSurface("end2.gif"));
draw::draw(96, 28, 128, 96, 0, 0);
draw::print2("LLASTIMA QUE ENCARA", 11, 17, WHITE, FONT_ZOOM_NONE);
draw::print2("NO HE TROBAT TOTES", 11, 19, WHITE, FONT_ZOOM_NONE);
draw::print2("LES ANBERNICS...", 13, 21, WHITE, FONT_ZOOM_NONE);
//draw::render();
break;
case 3: case 4: case 5: case 6: case 7: case 8:
case 9: case 10: case 11: case 12: case 13: case 14:
::game::setUpdateTicks(64);
if (act) actor::remove(act);
act = actor::createFromTemplate(actor_ids[stage-3]);
act->flags &= ~FLAG_MOVING;
break;
case 15:
if (act) actor::remove(act);
act = actor::createFromTemplate("GAT-BATMAN");
act->flags &= ~FLAG_MOVING;
break;
case 16:
if (act) actor::remove(act);
break;
}
}
switch (stage)
{
case 3: case 4: case 5: case 6: case 7: case 8:
case 9: case 10: case 11: case 12: case 13: case 14:
{
draw::cls(2);
draw::print2("THE POOL", 16, 3, TEAL, FONT_ZOOM_VERTICAL);
draw::swapcol(1,YELLOW);
actor::update(act, false);
actor::drawAt(act, 148, 100);
const int x = 160-strlen(actor_names[stage-3])*2;
draw::print(actor_names[stage-3], x, 145, WHITE, PAPER);
draw::print2("(C) JAILDOCTOR 2024", 11, 28, TEAL, FONT_ZOOM_NONE);
break;
}
case 15:
{
draw::cls(2);
draw::swapcol(1,GREEN);
actor::update(act, false);
actor::drawAt(act, 148, 100);
const int x = 160-strlen("DEDICAT A BATMAN")*2;
draw::print("DEDICAT A BATMAN", x, 145, WHITE, PAPER);
break;
}
case 16:
draw::cls(2);
draw::print2("GRACIES PER JUGAR!", 11, 15, PURPLE, FONT_ZOOM_NONE);
break;
}
draw::render();
return true;
}
}
}

10
source/m_end_sequence.h Normal file
View File

@@ -0,0 +1,10 @@
#pragma once
namespace modules
{
namespace end_sequence
{
void init();
bool loop();
}
}

View File

@@ -323,6 +323,7 @@ namespace modules
{
actor::update(actor::getFirst());
actor::hero::useBoostGod();
if ( (actor::hero::getParts()==0x3f) && (room::getCurrent()==45) ) return GAME_END;
}
}

View File

@@ -15,6 +15,7 @@ namespace modules
#define GAME_EDITOR_BITMAP_FILE 5
#define GAME_EDITOR_BITMAP_POS 6
#define GAME_EDITOR_BITMAP_SIZE 7
#define GAME_END 8
enum sections { SECTION_GENERAL, SECTION_ROOM, SECTION_ACTOR };

View File

@@ -13,16 +13,18 @@ namespace modules
{
namespace ingame
{
draw::surface *surf;
//draw::surface *surf;
int selected_option = INGAME_CONTINUAR;
actor::actor_t *parts[6] = {nullptr,nullptr,nullptr,nullptr,nullptr,nullptr};
actor::actor_t *anbernic = nullptr;
int num_anbernics = 0;
void init()
{
num_anbernics = actor::hero::getNumAmbernicsCollected();
selected_option = INGAME_CONTINUAR;
surf = draw::getSurface("objectes.gif");
//surf = draw::getSurface("objectes.gif");
if (parts[0]==nullptr)
{
parts[0] = actor::createFromTemplate("P-ELBOW");
@@ -65,6 +67,13 @@ namespace modules
parts[5]->inner_x=96+16;
parts[5]->inner_y=69+8;
}
if (anbernic==nullptr)
{
anbernic = actor::createFromTemplate("ANBERNIC");
anbernic->flags=0;
anbernic->inner_x=252;
anbernic->inner_y=76;
}
}
int loop()
@@ -85,20 +94,33 @@ namespace modules
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK) || input::keyPressed(SDL_SCANCODE_RETURN))
{
audio::playSound("snd_push.wav", SOUND_BASIC);
if (selected_option==INGAME_EIXIR)
{
for (int i=0; i<6; ++i) { actor::remove(parts[i]); parts[i]=nullptr;}
actor::remove(anbernic); anbernic=nullptr;
}
return selected_option;
}
draw::cls(2);
draw::color(1);
draw::setSource(surf);
//draw::setSource(surf);
static int part[6] = { PART_ELBOW, PART_PIPE, PART_SALT, PART_FILTER, PART_PUMP, PART_TIMER};
for (int i=0;i<6;++i)
{
draw::swapcol(1, room::getColor((actor::hero::getParts() & part[i])?1:3));
actor::drawAt(parts[i], parts[i]->inner_x, parts[i]->inner_y);
}
if (num_anbernics>0)
{
draw::restorecol(1);
actor::drawAt(anbernic, anbernic->inner_x, anbernic->inner_y);
char count[] = " 0/10";
count[1] = (num_anbernics%10)+48;
if (num_anbernics==10) count[0]='1';
draw::print2(count, 30, 12, WHITE, FONT_ZOOM_NONE);
}
draw::print2("PAUSA", 17, 3, TEAL, FONT_ZOOM_VERTICAL);

View File

@@ -6,6 +6,7 @@
#include "config.h"
#include <SDL2/SDL.h>
#include "jaudio.h"
#include "actor.h"
namespace modules
{
namespace menu
@@ -15,6 +16,8 @@ namespace modules
int retras=4;
int selected_option = OPTION_JUGAR;
bool prologo_desbloquejat = false;
int min_option = 1;
void init()
{
@@ -24,6 +27,7 @@ namespace modules
draw::loadPalette("test.gif");
surf = draw::getSurface("test.gif");
draw::restorecol(2);
if (config::isProgoloDesbloquejat()) min_option=0;
}
int loop()
@@ -34,13 +38,13 @@ namespace modules
if (controller::pressed(KEY_DOWN) || input::keyPressed(SDL_SCANCODE_DOWN))
{
audio::playSound("snd_push.wav", SOUND_BASIC);
selected_option++; if (selected_option==5) selected_option=0;
selected_option++; if (selected_option==6) selected_option=min_option;
}
if (controller::pressed(KEY_UP) || input::keyPressed(SDL_SCANCODE_UP))
{
audio::playSound("snd_push.wav", SOUND_BASIC);
selected_option--; if (selected_option<0) selected_option=4;
selected_option--; if (selected_option<min_option) selected_option=5;
}
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK) || input::keyPressed(SDL_SCANCODE_RETURN) )
@@ -62,7 +66,16 @@ namespace modules
switch (selected_option)
{
case OPTION_PROLOGO:
draw::print2("fg JUGAR AL PROLOGO", 11, 12, YELLOW, FONT_ZOOM_VERTICAL);
draw::print2("de JUGAR AL JOC", 11, 15, GREEN, FONT_ZOOM_NONE);
draw::print2("de REDEFINIR TECLES", 11, 17, GREEN, FONT_ZOOM_NONE);
draw::print2("de REDEFINIR GAMEPAD", 11, 19, GREEN, FONT_ZOOM_NONE);
draw::print2("de CONFIGURAR AUDIO", 11, 21, GREEN, FONT_ZOOM_NONE);
draw::print2("de EIXIR", 11, 23, GREEN, FONT_ZOOM_NONE);
break;
case OPTION_JUGAR:
if (config::isProgoloDesbloquejat()) draw::print2("de JUGAR AL PROLOGO", 11, 12, GREEN, FONT_ZOOM_NONE);
draw::print2("fg JUGAR AL JOC", 11, 14, YELLOW, FONT_ZOOM_VERTICAL);
draw::print2("de REDEFINIR TECLES", 11, 17, GREEN, FONT_ZOOM_NONE);
draw::print2("de REDEFINIR GAMEPAD", 11, 19, GREEN, FONT_ZOOM_NONE);
@@ -70,6 +83,7 @@ namespace modules
draw::print2("de EIXIR", 11, 23, GREEN, FONT_ZOOM_NONE);
break;
case OPTION_TECLES:
if (config::isProgoloDesbloquejat()) draw::print2("de JUGAR AL PROLOGO", 11, 12, GREEN, FONT_ZOOM_NONE);
draw::print2("de JUGAR AL JOC", 11, 14, GREEN, FONT_ZOOM_NONE);
draw::print2("fg REDEFINIR TECLES", 11, 16, YELLOW, FONT_ZOOM_VERTICAL);
draw::print2("de REDEFINIR GAMEPAD", 11, 19, GREEN, FONT_ZOOM_NONE);
@@ -77,6 +91,7 @@ namespace modules
draw::print2("de EIXIR", 11, 23, GREEN, FONT_ZOOM_NONE);
break;
case OPTION_GAMEPAD:
if (config::isProgoloDesbloquejat()) draw::print2("de JUGAR AL PROLOGO", 11, 12, GREEN, FONT_ZOOM_NONE);
draw::print2("de JUGAR AL JOC", 11, 14, GREEN, FONT_ZOOM_NONE);
draw::print2("de REDEFINIR TECLES", 11, 16, GREEN, FONT_ZOOM_NONE);
draw::print2("fg REDEFINIR GAMEPAD", 11, 18, YELLOW, FONT_ZOOM_VERTICAL);
@@ -84,6 +99,7 @@ namespace modules
draw::print2("de EIXIR", 11, 23, GREEN, FONT_ZOOM_NONE);
break;
case OPTION_AUDIO:
if (config::isProgoloDesbloquejat()) draw::print2("de JUGAR AL PROLOGO", 11, 12, GREEN, FONT_ZOOM_NONE);
draw::print2("de JUGAR AL JOC", 11, 14, GREEN, FONT_ZOOM_NONE);
draw::print2("de REDEFINIR TECLES", 11, 16, GREEN, FONT_ZOOM_NONE);
draw::print2("de REDEFINIR GAMEPAD", 11, 18, GREEN, FONT_ZOOM_NONE);
@@ -91,6 +107,7 @@ namespace modules
draw::print2("de EIXIR", 11, 23, GREEN, FONT_ZOOM_NONE);
break;
case OPTION_EIXIR:
if (config::isProgoloDesbloquejat()) draw::print2("de JUGAR AL PROLOGO", 11, 12, GREEN, FONT_ZOOM_NONE);
draw::print2("de JUGAR AL JOC", 11, 14, GREEN, FONT_ZOOM_NONE);
draw::print2("de REDEFINIR TECLES", 11, 16, GREEN, FONT_ZOOM_NONE);
draw::print2("de REDEFINIR GAMEPAD", 11, 18, GREEN, FONT_ZOOM_NONE);

View File

@@ -5,11 +5,12 @@ namespace modules
namespace menu
{
#define OPTION_NONE -1
#define OPTION_JUGAR 0
#define OPTION_TECLES 1
#define OPTION_GAMEPAD 2
#define OPTION_AUDIO 3
#define OPTION_EIXIR 4
#define OPTION_PROLOGO 0
#define OPTION_JUGAR 1
#define OPTION_TECLES 2
#define OPTION_GAMEPAD 3
#define OPTION_AUDIO 4
#define OPTION_EIXIR 5
void init();
int loop();

View File

@@ -27,6 +27,8 @@
#include "m_editor_colors.h"
#include "m_editor_bitmap_file.h"
#include "m_editor_bitmap.h"
#include "m_end_sequence.h"
#define M_LOGO 0
#define M_INTRO 1
@@ -43,6 +45,7 @@
#define M_EDITOR_COLORS 12
#define M_EDITOR_BITMAP_FILE 13
#define M_EDITOR_BITMAP 14
#define M_END 15
int current_module = M_LOGO;
@@ -56,6 +59,8 @@ void loadConfig()
if (strcmp(file::getConfigValue("music").c_str(), "no")==0) config::setMusic(false);
if (strcmp(file::getConfigValue("prologo").c_str(), "unlocked")==0) config::setProgoloDesbloquejat();
const char *so = file::getConfigValue("sound").c_str();
if (strcmp(so, "basic")==0)
config::setSound(SOUND_BASIC);
@@ -140,11 +145,14 @@ bool game::loop()
switch(current_module)
{
case M_LOGO:
if (!modules::logo::loop()) { modules::intro::init(); current_module = M_INTRO; }
if (!modules::logo::loop()) { modules::intro::init(); current_module = M_END; }
break;
case M_INTRO:
if (!modules::intro::loop()) { modules::menu::init(); current_module = M_MENU; }
break;
case M_END:
if (!modules::end_sequence::loop()) { modules::menu::init(); current_module = M_MENU; }
break;
case M_MENU:
option = modules::menu::loop();
if (option != OPTION_NONE) {
@@ -182,7 +190,8 @@ bool game::loop()
modules::editor_bitmap::init(EDITING_BITMAP_POS); current_module = M_EDITOR_BITMAP;
} else if (option==GAME_EDITOR_BITMAP_SIZE) {
modules::editor_bitmap::init(EDITING_BITMAP_SIZE); current_module = M_EDITOR_BITMAP;
}
} else if (option==GAME_END) { modules::end_sequence::init(); current_module = M_END; }
}
break;
case M_EDITOR_MAP:
@@ -245,7 +254,6 @@ bool game::loop()
modules::menu::init(); current_module = M_MENU;
}
break;
};
return true;
}

View File

@@ -277,6 +277,12 @@ namespace room
act->flags &= ~FLAG_ANIMATED;
act->bmp_rect.x += act->bmp_rect.w;
}
} else if (act->name[0]=='A') { // Es una anbernic
if (!::editor::isDevMode() && actor::hero::wasAnbernicCollected(act->name))
{
actor::remove(act);
act = nullptr;
}
}
}
if (act) actor::setDirty(act, true);