This commit is contained in:
2024-10-09 10:10:23 +02:00
16 changed files with 339 additions and 119 deletions

View File

@@ -22,6 +22,8 @@ mapa.gif
objectes.gif objectes.gif
obrer.gif obrer.gif
piscina.gif piscina.gif
prologo1.gif
prologo2.gif
roomaux.gif roomaux.gif
sam.gif sam.gif
test.gif test.gif

BIN
data/prologo1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
data/prologo2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -176,11 +176,11 @@ actor{
} }
actor{ actor{
name: S-BAG name: X-0
bmp: objectes.gif bmp: objectes.gif
bmp-rect: 145 41 20 25 bmp-rect: 162 0 28 22
bmp-offset: -5 27 bmp-offset: -3 24
pos: 31 13 16 pos: 8 32 0
size: 4 4 4 size: 4 4 4
anim-cycle: SEQ anim-cycle: SEQ
anim-wait: 2 anim-wait: 2
@@ -189,25 +189,12 @@ actor{
} }
actor{ actor{
name: S-GLOVES name: X-1
bmp: objectes.gif
bmp-rect: 165 45 21 22
bmp-offset: -2 26
pos: 24 14 4
size: 4 4 4
anim-cycle: SEQ
anim-wait: 2
flags: SPECIAL
movement: CW
}
actor{
name: S-PANTS
bmp: objectes.gif bmp: objectes.gif
bmp-rect: 167 22 18 23 bmp-rect: 167 22 18 23
bmp-offset: -7 27 bmp-offset: -7 27
pos: 16 24 4 pos: 16 24 4
size: 4 4 4 size: 4 4 6
anim-cycle: SEQ anim-cycle: SEQ
anim-wait: 2 anim-wait: 2
flags: SPECIAL flags: SPECIAL
@@ -215,12 +202,25 @@ actor{
} }
actor{ actor{
name: S-SHOES name: X-2
bmp: objectes.gif bmp: objectes.gif
bmp-rect: 162 0 28 22 bmp-rect: 165 45 21 22
bmp-offset: -3 24 bmp-offset: -2 26
pos: 0 24 0 pos: 24 14 4
size: 4 4 4 size: 4 4 5
anim-cycle: SEQ
anim-wait: 2
flags: SPECIAL
movement: CW
}
actor{
name: X-3
bmp: objectes.gif
bmp-rect: 145 41 20 25
bmp-offset: -5 27
pos: 34 13 16
size: 6 4 6
anim-cycle: SEQ anim-cycle: SEQ
anim-wait: 2 anim-wait: 2
flags: SPECIAL flags: SPECIAL

View File

@@ -210,19 +210,6 @@ actor{
movement: Y movement: Y
} }
actor{
name: S-GLOVES
bmp: objectes.gif
bmp-rect: 165 45 21 22
bmp-offset: -2 26
pos: 8 22 0
size: 4 4 4
anim-cycle: SEQ
anim-wait: 2
flags: SPECIAL
movement: CW
}
actor{ actor{
name: WC name: WC
bmp: altres.gif bmp: altres.gif
@@ -234,3 +221,16 @@ actor{
flags: ORIENTABLE flags: ORIENTABLE
movement: CCW movement: CCW
} }
actor{
name: Y-2
bmp: objectes.gif
bmp-rect: 165 45 21 22
bmp-offset: -2 26
pos: 8 22 0
size: 4 4 5
anim-cycle: SEQ
anim-wait: 2
flags: SPECIAL
movement: CW
}

View File

@@ -94,19 +94,6 @@ actor{
movement: Y movement: Y
} }
actor{
name: S-PANTS
bmp: objectes.gif
bmp-rect: 167 22 18 23
bmp-offset: -7 27
pos: 0 16 0
size: 4 4 4
anim-cycle: SEQ
anim-wait: 2
flags: SPECIAL
movement: CW
}
actor{ actor{
name: TRANSPA-00 name: TRANSPA-00
bmp: altres.gif bmp: altres.gif
@@ -316,3 +303,16 @@ actor{
size: 8 8 6 size: 8 8 6
movement: CW movement: CW
} }
actor{
name: Y-1
bmp: objectes.gif
bmp-rect: 167 22 18 23
bmp-offset: -7 27
pos: 0 16 0
size: 4 4 6
anim-cycle: SEQ
anim-wait: 2
flags: SPECIAL
movement: CW
}

View File

@@ -402,12 +402,12 @@ actor{
} }
actor{ actor{
name: S-SHOES name: Y-0
bmp: objectes.gif bmp: objectes.gif
bmp-rect: 162 0 28 22 bmp-rect: 162 0 28 22
bmp-offset: -3 24 bmp-offset: -3 24
pos: 40 0 4 pos: 40 0 4
size: 4 4 4 size: 6 6 4
anim-cycle: SEQ anim-cycle: SEQ
anim-wait: 2 anim-wait: 2
flags: SPECIAL flags: SPECIAL

View File

@@ -155,19 +155,6 @@ actor{
movement: Y movement: Y
} }
actor{
name: S-BAG
bmp: objectes.gif
bmp-rect: 145 41 20 25
bmp-offset: -5 27
pos: 0 56 20
size: 4 4 4
anim-cycle: SEQ
anim-wait: 2
flags: SPECIAL
movement: CW
}
actor{ actor{
name: TRANSPA-00 name: TRANSPA-00
bmp: altres.gif bmp: altres.gif
@@ -268,3 +255,16 @@ actor{
flags: PUSHABLE GRAVITY flags: PUSHABLE GRAVITY
movement: CW movement: CW
} }
actor{
name: Y-3
bmp: objectes.gif
bmp-rect: 145 41 20 25
bmp-offset: -5 27
pos: 0 56 20
size: 6 4 6
anim-cycle: SEQ
anim-wait: 2
flags: SPECIAL
movement: CW
}

View File

@@ -676,6 +676,36 @@ namespace actor
hero::pickAnbernic(act->name); hero::pickAnbernic(act->name);
audio::playSound("snd_pick.wav", SOUND_BASIC); audio::playSound("snd_pick.wav", SOUND_BASIC);
} }
else if (act->name[0] == 'X')
{
if (hero::isCarryingPrologoObject()) {
audio::playSound("snd_push.wav", SOUND_BASIC);
return result;
} else {
hero::pickPrologoObject(act->name[2]-48);
audio::playSound("snd_pick.wav", SOUND_BASIC);
}
}
else if (act->name[0] == 'Y')
{
const int which = act->name[2]-48;
if (hero::getPrologoObjectState(which)==PROLOGO_OBJECT_PICKED)
{
hero::leavePrologoObject(which);
audio::playSound("snd_pick.wav", SOUND_BASIC);
act->name[0] = 'Z';
room::cycleColor(1);
return result;
} else {
audio::playSound("snd_push.wav", SOUND_BASIC);
return result;
}
}
else if (act->name[0] == 'Z')
{
audio::playSound("snd_push.wav", SOUND_BASIC);
return result;
}
else else
{ {
SDL_assert(false); SDL_assert(false);
@@ -1506,9 +1536,10 @@ namespace actor
if (editor::isEditing() && (act == selected) && modules::game::getSection() == modules::game::SECTION_ACTOR) if (editor::isEditing() && (act == selected) && modules::game::getSection() == modules::game::SECTION_ACTOR)
draw::swapcol(1, room::getColor(1)); // Si està seleccionat, que canvie de color draw::swapcol(1, room::getColor(1)); // Si està seleccionat, que canvie de color
draw::stencil::set(act->tag); 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); if (!(act->flags & FLAG_SPECIAL) || !(act->name[0] == 'Y') || (brilli_brilli<4) )
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 draw::swapcol(1, room::getColor(0)); // Tornem al color per defecte
if ((act->flags & FLAG_SPECIAL) && (act->name[0] != 'A')) if ((act->flags & FLAG_SPECIAL) && (act->name[0] != 'A') && (act->name[0] != 'Z'))
{ {
draw::setSource(brilli); draw::setSource(brilli);
const int dx = (act->bmp_rect.w - 22) >> 1; const int dx = (act->bmp_rect.w - 22) >> 1;
@@ -1923,10 +1954,11 @@ namespace actor
int first_orient = 0; int first_orient = 0;
bool dead = false; bool dead = false;
bool prologo = false; bool prologo = false;
int prologo_objects[4] = {PROLOGO_OBJECT_INITIAL, PROLOGO_OBJECT_INITIAL, PROLOGO_OBJECT_INITIAL, PROLOGO_OBJECT_INITIAL};
void setPrologo() void setPrologo(const bool value)
{ {
prologo = true; prologo = value;
} }
const bool isPrologo() const bool isPrologo()
@@ -1957,6 +1989,7 @@ namespace actor
lives = 8; lives = 8;
skills = SKILL_NONE; skills = SKILL_NONE;
if (prologo) skills &= SKILL_SHOES; if (prologo) skills &= SKILL_SHOES;
for (int i=0;i<4;++i) prologo_objects[i] = PROLOGO_OBJECT_INITIAL;
parts = PART_NONE; parts = PART_NONE;
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
anbernics[i] = false; anbernics[i] = false;
@@ -2244,6 +2277,27 @@ namespace actor
return count; return count;
} }
void pickPrologoObject(int which)
{
prologo_objects[which] = PROLOGO_OBJECT_PICKED;
}
void leavePrologoObject(int which)
{
prologo_objects[which] = PROLOGO_OBJECT_LEFT;
}
const bool isCarryingPrologoObject()
{
for (auto object : prologo_objects) if (object==PROLOGO_OBJECT_PICKED) return true;
return false;
}
const int getPrologoObjectState(int which)
{
return prologo_objects[which];
}
void move(int *x, int *y, int *z) void move(int *x, int *y, int *z)
{ {
actor_t *hero = actor::find("HERO"); actor_t *hero = actor::find("HERO");

View File

@@ -198,7 +198,16 @@ namespace actor
namespace hero namespace hero
{ {
void setPrologo(); #define PROLOGO_OBJECT_INITIAL 0
#define PROLOGO_OBJECT_PICKED 1
#define PROLOGO_OBJECT_LEFT 2
#define PROLOGO_SHOES 0
#define PROLOGO_PANTS 1
#define PROLOGO_GLOVES 2
#define PROLOGO_BAG 3
void setPrologo(const bool value);
const bool isPrologo(); const bool isPrologo();
void init(const bool complete = true); void init(const bool complete = true);
int getLives(); int getLives();
@@ -239,6 +248,11 @@ namespace actor
bool wasAnbernicCollected(char *name); bool wasAnbernicCollected(char *name);
int getNumAmbernicsCollected(); int getNumAmbernicsCollected();
void pickPrologoObject(int which);
void leavePrologoObject(int which);
const bool isCarryingPrologoObject();
const int getPrologoObjectState(int which);
void move(int *x, int *y, int *z); void move(int *x, int *y, int *z);
void setFirstPos(); void setFirstPos();
} }

View File

@@ -24,7 +24,7 @@ namespace modules
void init(const bool prologo) void init(const bool prologo)
{ {
if (prologo) actor::hero::setPrologo(); actor::hero::setPrologo(prologo);
actor::clear(true); actor::clear(true);
::game::setUpdateTicks(64); ::game::setUpdateTicks(64);
actor::templates::load(); actor::templates::load();
@@ -339,7 +339,9 @@ namespace modules
room::draw(); room::draw();
actor::actor_t *selected = actor::getSelected(); actor::actor_t *selected = actor::getSelected();
if (editor::isDevMode() && selected && input::keyPressed(SDL_SCANCODE_M)) actor::setFloatingEditing(true); const bool inside_room_zone = (draw::getLocalX(input::mouseX())>=0 && draw::getLocalY(input::mouseY())>=0 && draw::getLocalX(input::mouseX())<320 && draw::getLocalY(input::mouseY())<240);
if (editor::isDevMode() && selected && inside_room_zone && input::keyPressed(SDL_SCANCODE_M)) actor::setFloatingEditing(true);
if (editor::isDevMode() && actor::getFloatingEditing() && selected) { if (editor::isDevMode() && actor::getFloatingEditing() && selected) {
draw::swapcol(1, GREEN+LIGHT); draw::swapcol(1, GREEN+LIGHT);
@@ -396,45 +398,64 @@ namespace modules
draw::print2("no", 4, 25, col3, FONT_ZOOM_NONE); draw::print2("no", 4, 25, col3, FONT_ZOOM_NONE);
draw::print2(actor::hero::getLives(), 2, 4, 26, col1, FONT_ZOOM_VERTICAL); draw::print2(actor::hero::getLives(), 2, 4, 26, col1, FONT_ZOOM_VERTICAL);
draw::print2("a", 9, 26, col1, FONT_ZOOM_NONE); if (!actor::hero::isPrologo())
draw::print2("b", 12, 26, col2, FONT_ZOOM_NONE);
draw::print2("c", 15, 26, col3, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostJump(), 2, 8, 27, col3, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostGod()/2, 2, 11, 27, col1, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostRun()/2, 2, 14, 27, col2, FONT_ZOOM_NONE);
draw::stencil::enable();
draw::stencil::clear(255);
draw::setSource(draw::getSurface("objectes.gif"));
draw::stencil::set(SKILL_SHOES);
draw::swapcol(1, actor::hero::getSkills()&SKILL_SHOES ? col1 : col3);
draw::draw(276,166, 28, 22, 162, 0);
draw::stencil::set(SKILL_PANTS);
draw::swapcol(1, actor::hero::getSkills()&SKILL_PANTS ? col1 : col3);
draw::draw(250,183, 18, 23, 167, 22);
draw::stencil::set(SKILL_GLOVES);
draw::swapcol(1, actor::hero::getSkills()&SKILL_GLOVES ? col1 : col3);
draw::draw(222,200, 21, 22, 165, 45);
draw::stencil::set(SKILL_BAG);
draw::swapcol(1, actor::hero::getSkills()&SKILL_BAG ? col1 : col3);
draw::draw(279,200, 20, 25, 145, 41);
draw::stencil::disable();
// Si estem en el editor, fent click en els skills del marcador els obtenim
if (editor::isDevMode() && input::mouseClk(1))
{ {
const uint8_t val = draw::stencil::query(input::mouseX(), input::mouseY()); draw::print2("a", 9, 26, col1, FONT_ZOOM_NONE);
if (val != 255) draw::print2("b", 12, 26, col2, FONT_ZOOM_NONE);
draw::print2("c", 15, 26, col3, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostJump(), 2, 8, 27, col3, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostGod()/2, 2, 11, 27, col1, FONT_ZOOM_NONE);
draw::print2(actor::hero::getBoostRun()/2, 2, 14, 27, col2, FONT_ZOOM_NONE);
draw::stencil::enable();
draw::stencil::clear(255);
draw::setSource(draw::getSurface("objectes.gif"));
draw::stencil::set(SKILL_SHOES);
draw::swapcol(1, actor::hero::getSkills()&SKILL_SHOES ? col1 : col3);
draw::draw(276,166, 28, 22, 162, 0);
draw::stencil::set(SKILL_PANTS);
draw::swapcol(1, actor::hero::getSkills()&SKILL_PANTS ? col1 : col3);
draw::draw(250,183, 18, 23, 167, 22);
draw::stencil::set(SKILL_GLOVES);
draw::swapcol(1, actor::hero::getSkills()&SKILL_GLOVES ? col1 : col3);
draw::draw(222,200, 21, 22, 165, 45);
draw::stencil::set(SKILL_BAG);
draw::swapcol(1, actor::hero::getSkills()&SKILL_BAG ? col1 : col3);
draw::draw(279,200, 20, 25, 145, 41);
draw::stencil::disable();
// Si estem en el editor, fent click en els skills del marcador els obtenim
if (editor::isDevMode() && input::mouseClk(1))
{ {
if (actor::hero::getSkills() & val) const uint8_t val = draw::stencil::query(input::mouseX(), input::mouseY());
actor::hero::dropSkill(val); if (val != 255)
else {
actor::hero::giveSkill(val); if (actor::hero::getSkills() & val)
actor::hero::dropSkill(val);
room::cycleColor(1); else
actor::hero::giveSkill(val);
room::cycleColor(1);
}
}
} else if (actor::hero::isCarryingPrologoObject())
{
draw::setSource(draw::getSurface("objectes.gif"));
if (actor::hero::getPrologoObjectState(PROLOGO_SHOES)==PROLOGO_OBJECT_PICKED)
{
draw::draw(276,166, 28, 22, 162, 0);
} else if (actor::hero::getPrologoObjectState(PROLOGO_PANTS)==PROLOGO_OBJECT_PICKED)
{
draw::draw(276,166, 18, 23, 167, 22);
} else if (actor::hero::getPrologoObjectState(PROLOGO_GLOVES)==PROLOGO_OBJECT_PICKED)
{
draw::draw(276,166, 21, 22, 165, 45);
} else if (actor::hero::getPrologoObjectState(PROLOGO_BAG)==PROLOGO_OBJECT_PICKED)
{
draw::draw(276,166, 20, 25, 145, 41);
} }
} }
} }
@@ -667,8 +688,7 @@ namespace modules
} }
draw::setViewport(420, 15, 100, 225); draw::setViewport(420, 15, 100, 225);
mx = draw::getLocalX(input::mouseX());
my = draw::getLocalY(input::mouseY());
bool changed = false; bool changed = false;
@@ -897,8 +917,8 @@ namespace modules
draw::color(PAPER); draw::color(PAPER);
draw::rect(2, 0, 96, 204); draw::rect(2, 0, 96, 204);
if (ui::button("DUPLICATE", 2, line, 48, 11) || input::keyPressed(SDL_SCANCODE_D)) if (ui::button("DUPLICATE", 2, line, 48, 11) || ( input::keyPressed(SDL_SCANCODE_D) && inside_room_zone))
{ {
actor::actor_t *new_act = actor::duplicate(act); actor::actor_t *new_act = actor::duplicate(act);
actor::setUniqueName(new_act); actor::setUniqueName(new_act);
@@ -908,7 +928,7 @@ namespace modules
actor::setFloatingEditing(true); actor::setFloatingEditing(true);
changed = true; changed = true;
} }
if (ui::button("DELETE", 48, line, 48, 11) || input::keyPressed(SDL_SCANCODE_DELETE)) if (ui::button("DELETE", 48, line, 48, 11) || ( input::keyPressed(SDL_SCANCODE_DELETE) && inside_room_zone))
{ {
actor::remove(act); actor::remove(act);
act = nullptr; act = nullptr;

View File

@@ -19,7 +19,12 @@ namespace modules
{ {
if (audio::getCurrentMusic() != "mus_gameover.ogg") audio::playMusic("mus_gameover.ogg", 0); if (audio::getCurrentMusic() != "mus_gameover.ogg") audio::playMusic("mus_gameover.ogg", 0);
if (heroi == nullptr) heroi = actor::create("HERO", {16,32,8}, {6,6,12}, "test.gif", {0,32,20,32}, {-6,38}); if (heroi) actor::remove(heroi);
if (actor::hero::isPrologo()) {
heroi = actor::create("HERO", {16, 32, 0}, {6, 6, 8}, "gat.gif", {0, 0, 24, 28}, {-4, 32});
} else {
heroi = actor::create("HERO", {16,32,8}, {6,6,12}, "test.gif", {0,32,20,32}, {-6,38});
}
heroi->flags = FLAG_ANIMATED; heroi->flags = FLAG_ANIMATED;
int milliseconds = SDL_GetTicks()-actor::stats::getStartTime(); int milliseconds = SDL_GetTicks()-actor::stats::getStartTime();
@@ -50,8 +55,16 @@ namespace modules
draw::print2("GAME OVER", 15, 7, YELLOW, FONT_ZOOM_VERTICAL); draw::print2("GAME OVER", 15, 7, YELLOW, FONT_ZOOM_VERTICAL);
draw::print2(actor::stats::getNumPartsCollected(), 2, 11, 12, TEAL, FONT_ZOOM_NONE); if (actor::hero::isPrologo())
draw::print2("PARTS TROBADES", 14, 12, GREEN, FONT_ZOOM_NONE); {
int num_objectes = 0;
for (int i=0;i<4;++i) if (actor::hero::getPrologoObjectState(i)==PROLOGO_OBJECT_LEFT) num_objectes++;
draw::print2(num_objectes, 2, 11, 12, TEAL, FONT_ZOOM_NONE);
draw::print2("OBJECTES DEJATS", 14, 12, GREEN, FONT_ZOOM_NONE);
} else {
draw::print2(actor::stats::getNumPartsCollected(), 2, 11, 12, TEAL, FONT_ZOOM_NONE);
draw::print2("PARTS TROBADES", 14, 12, GREEN, FONT_ZOOM_NONE);
}
draw::print2(actor::stats::getRoomsVisited(), 2, 8, 14, TEAL, FONT_ZOOM_NONE); draw::print2(actor::stats::getRoomsVisited(), 2, 8, 14, TEAL, FONT_ZOOM_NONE);
draw::print2("HABITACIONS VISITADES", 11, 14, GREEN, FONT_ZOOM_NONE); draw::print2("HABITACIONS VISITADES", 11, 14, GREEN, FONT_ZOOM_NONE);

View File

@@ -0,0 +1,92 @@
#include "m_prologo_intro.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 prologo_intro
{
int stage = 0;
uint32_t time = 0;
void init()
{
time = SDL_GetTicks();
draw::restorecol(2);
draw::cls(2);
draw::swapcol(1, 9);
draw::setSource(draw::getSurface("prologo1.gif"));
draw::draw(96, 28, 128, 96, 0, 0);
draw::print2("ME ANE A ESCABUSSARME", 10, 17, WHITE, FONT_ZOOM_NONE);
draw::print2("EN LA NOVA PISCINA!", 11, 19, WHITE, FONT_ZOOM_NONE);
draw::render();
if (audio::getCurrentMusic() != "mus_menu.ogg") audio::playMusic("mus_menu.ogg");
}
const bool shouldGoToNext()
{
return (SDL_GetTicks()-time > (stage==8?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,PURPLE);
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 == 4) return false;
switch (stage)
{
case 1:
draw::cls(2);
draw::swapcol(1, 9);
draw::setSource(draw::getSurface("prologo2.gif"));
draw::draw(96, 28, 128, 96, 0, 0);
draw::print2("MIRA, ESTE SA DEJAT", 10, 17, WHITE, FONT_ZOOM_NONE);
draw::print2("TOT TIRADO PER AI...", 10, 19, WHITE, FONT_ZOOM_NONE);
//draw::render();
break;
case 2:
draw::cls(2);
draw::swapcol(1, 9);
draw::setSource(draw::getSurface("prologo2.gif"));
draw::draw(96, 28, 128, 96, 0, 0);
draw::print2("BACH A DEJARO TOT", 12, 17, WHITE, FONT_ZOOM_NONE);
draw::print2("EN SU PUESTO!", 14, 19, WHITE, FONT_ZOOM_NONE);
//draw::render();
break;
case 3:
draw::cls(2);
draw::swapcol(1, 9);
draw::setSource(draw::getSurface("prologo2.gif"));
draw::draw(96, 28, 128, 96, 0, 0);
draw::print2("BORAS QUE FELIS", 12, 17, WHITE, FONT_ZOOM_NONE);
draw::print2("SE PONE!", 15, 19, WHITE, FONT_ZOOM_NONE);
//draw::render();
break;
}
}
draw::render();
return true;
}
}
}

10
source/m_prologo_intro.h Normal file
View File

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

View File

@@ -28,7 +28,7 @@
#include "m_editor_bitmap_file.h" #include "m_editor_bitmap_file.h"
#include "m_editor_bitmap.h" #include "m_editor_bitmap.h"
#include "m_end_sequence.h" #include "m_end_sequence.h"
#include "m_prologo_intro.h"
#define M_LOGO 0 #define M_LOGO 0
#define M_INTRO 1 #define M_INTRO 1
@@ -46,6 +46,7 @@
#define M_EDITOR_BITMAP_FILE 13 #define M_EDITOR_BITMAP_FILE 13
#define M_EDITOR_BITMAP 14 #define M_EDITOR_BITMAP 14
#define M_END 15 #define M_END 15
#define M_PROLOGO_INTRO 16
int current_module = M_LOGO; int current_module = M_LOGO;
@@ -150,6 +151,9 @@ bool game::loop()
case M_INTRO: case M_INTRO:
if (!modules::intro::loop()) { modules::menu::init(); current_module = M_MENU; } if (!modules::intro::loop()) { modules::menu::init(); current_module = M_MENU; }
break; break;
case M_PROLOGO_INTRO:
if (!modules::prologo_intro::loop()) { modules::game::init(true); current_module = M_GAME; }
break;
case M_END: case M_END:
if (!modules::end_sequence::loop()) { modules::menu::init(); current_module = M_MENU; } if (!modules::end_sequence::loop()) { modules::menu::init(); current_module = M_MENU; }
break; break;
@@ -157,7 +161,7 @@ bool game::loop()
option = modules::menu::loop(); option = modules::menu::loop();
if (option != OPTION_NONE) { if (option != OPTION_NONE) {
if (option == OPTION_EIXIR) return false; if (option == OPTION_EIXIR) return false;
if (option == OPTION_PROLOGO) { modules::game::init(true); current_module = M_GAME; } if (option == OPTION_PROLOGO) { modules::prologo_intro::init(); current_module = M_PROLOGO_INTRO; }
if (option == OPTION_JUGAR) { modules::game::init(); current_module = M_GAME; } if (option == OPTION_JUGAR) { modules::game::init(); current_module = M_GAME; }
if (option == OPTION_TECLES) { modules::menu_tecles::init(); current_module = M_MENU_TECLES; } if (option == OPTION_TECLES) { modules::menu_tecles::init(); current_module = M_MENU_TECLES; }
if (option == OPTION_GAMEPAD) { modules::menu_gamepad::init(); current_module = M_MENU_GAMEPAD; } if (option == OPTION_GAMEPAD) { modules::menu_gamepad::init(); current_module = M_MENU_GAMEPAD; }

View File

@@ -283,6 +283,17 @@ namespace room
actor::remove(act); actor::remove(act);
act = nullptr; act = nullptr;
} }
} else if (act->name[0]=='X') { // Es un objecte del prólogo sense arreplegar
if (!::editor::isDevMode() && actor::hero::getPrologoObjectState(act->name[2]-48)!=PROLOGO_OBJECT_INITIAL)
{
actor::remove(act);
act = nullptr;
}
} else if (act->name[0]=='Y') { // Es un hueco on deixar un objecte del prólogo
if (!::editor::isDevMode() && actor::hero::getPrologoObjectState(act->name[2]-48)==PROLOGO_OBJECT_LEFT)
{
act->name[0] = 'Z';
}
} }
} }
if (act) actor::setDirty(act, true); if (act) actor::setDirty(act, true);